|
1 | | -############################ |
2 | | -# Common vars |
3 | | -############################ |
4 | 1 | 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)." |
6 | 3 | type = string |
7 | 4 | default = "dev" |
8 | 5 | } |
9 | 6 |
|
10 | | -############################ |
11 | | -# Resource group vars |
12 | | -############################ |
13 | 7 | 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." |
16 | 9 | type = string |
| 10 | + default = "West Europe" |
17 | 11 | } |
18 | 12 |
|
19 | 13 | 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." |
21 | 15 | type = string |
22 | 16 | } |
23 | 17 |
|
24 | | -############################ |
25 | | -# CosmosDB variables |
26 | | -############################ |
27 | 18 | 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." |
29 | 20 | type = string |
30 | 21 | } |
31 | 22 |
|
32 | 23 | 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." |
34 | 25 | type = string |
35 | 26 | } |
36 | 27 |
|
37 | 28 | 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." |
39 | 30 | type = string |
40 | 31 | } |
41 | 32 |
|
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"] |
45 | 37 | } |
46 | 38 |
|
47 | 39 | 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." |
49 | 41 | type = number |
50 | 42 | default = 1 |
51 | 43 | } |
52 | 44 |
|
53 | 45 | 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 |
56 | 85 | } |
0 commit comments