Skip to content

Commit d02345e

Browse files
authored
Update variables.tf
1 parent 10e5b85 commit d02345e

File tree

1 file changed

+51
-22
lines changed

1 file changed

+51
-22
lines changed

variables.tf

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,85 @@
1-
############################
2-
# Common vars
3-
############################
41
variable "environment" {
5-
description = "Variable used for backend container name key."
2+
description = "The environment name used for backend container naming (e.g., dev, staging, prod)."
63
type = string
74
default = "dev"
85
}
96

10-
############################
11-
# Resource group vars
12-
############################
137
variable "resource_group_location" {
14-
description = "Specifies the supported Azure location where the resource group exists. Changing this forces a new resource to be created."
15-
default = "West Europe"
8+
description = "The Azure location where the resource group is created. Changing this value forces the creation of a new resource."
169
type = string
10+
default = "West Europe"
1711
}
1812

1913
variable "resource_group_name" {
20-
description = "The name of the resource group in which to create resources. Changing this forces a new resource to be created."
14+
description = "The name of the resource group in which to create the Cosmos DB SQL container. Changing this value forces the creation of a new resource."
2115
type = string
2216
}
2317

24-
############################
25-
# CosmosDB variables
26-
############################
2718
variable "cosmosdb_account_name" {
28-
description = "Specifies the name of the Cosmos DB account. Changing this forces a new resource to be created."
19+
description = "The name of the Cosmos DB account. Changing this value forces the creation of a new resource."
2920
type = string
3021
}
3122

3223
variable "cosmosdb_sql_database_name" {
33-
description = "Specifies the name of the Cosmos DB SQL database. Changing this forces a new resource to be created."
24+
description = "The name of the Cosmos DB SQL database. Changing this value forces the creation of a new resource."
3425
type = string
3526
}
3627

3728
variable "cosmosdb_sql_database_container_name" {
38-
description = "Specifies the name of the Cosmos DB SQL container. Changing this forces a new resource to be created."
29+
description = "The name of the Cosmos DB SQL container to be created."
3930
type = string
4031
}
4132

42-
variable "cosmosdb_sql_database_container_partition_key_path" {
43-
description = "Defines the partition key path for the container. Changing this forces a new resource to be created."
44-
type = string
33+
variable "cosmosdb_sql_database_container_partition_key_paths" {
34+
description = "A list of partition key paths for the Cosmos DB SQL container. Partition keys are essential for scalable performance in Cosmos DB."
35+
type = list(string)
36+
default = ["/myPartitionKey"]
4537
}
4638

4739
variable "cosmosdb_sql_database_container_partition_key_version" {
48-
description = "Defines the partition key version. Changing this forces a new resource to be created. Possible values are 1 and 2. This should be set to 2 in order to use large partition keys."
40+
description = "The version of the partition key for the Cosmos DB SQL container. Defaults to 1."
4941
type = number
5042
default = 1
5143
}
5244

5345
variable "sql_database_container_paths" {
54-
description = "List of Cosmos DB SQL container paths to create. Some parameters are inherited from the Cosmos account."
55-
type = list(string) # Changed to list to reflect multiple paths
46+
description = "List of Cosmos DB SQL containers to create. Some parameters are inherited from the Cosmos DB account."
47+
type = string
48+
}
49+
50+
variable "conflict_resolution_policy" {
51+
description = "The conflict resolution policy for the Cosmos DB SQL container, which determines how conflicting changes are resolved."
52+
type = object({
53+
mode = string # E.g., 'LastWriterWins' or 'Custom'.
54+
conflict_resolution_path = string # Path used for resolving conflicts, applicable for 'LastWriterWins' mode.
55+
})
56+
default = null
57+
}
58+
59+
variable "unique_keys" {
60+
description = "A list of unique keys for the Cosmos DB SQL container to ensure uniqueness of specified paths."
61+
type = list(object({
62+
paths = list(string) # Paths defining the unique key constraints.
63+
}))
64+
default = null
65+
}
66+
67+
variable "indexing_policy" {
68+
description = "The indexing policy for the Cosmos DB SQL container, which specifies how items are indexed for queries."
69+
type = object({
70+
indexing_mode = string # Either 'consistent' or 'none'.
71+
included_paths = list(object({
72+
path = string # Paths explicitly included in the index.
73+
}))
74+
excluded_paths = list(object({
75+
path = string # Paths explicitly excluded from the index.
76+
}))
77+
})
78+
default = null
79+
}
80+
81+
variable "default_ttl" {
82+
description = "Default time-to-live (TTL) for the Cosmos DB SQL container, specified in seconds. If null, TTL is not configured."
83+
type = number
84+
default = null
5685
}

0 commit comments

Comments
 (0)