-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
43 lines (38 loc) · 1.29 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
resource "azurerm_cosmosdb_account" "this" {
name = var.name
location = var.location
resource_group_name = var.resource_group_name
offer_type = var.offer_type
kind = var.kind
access_key_metadata_writes_enabled = var.enable_access_key_metadata_writes
automatic_failover_enabled = var.enable_automatic_failover
backup {
interval_in_minutes = var.backup_interval
retention_in_hours = var.backup_retention
storage_redundancy = "Geo"
type = "Periodic"
}
consistency_policy {
consistency_level = var.consistency_level
max_interval_in_seconds = var.consistency_level == "BoundedStaleness" ? 300 : null
max_staleness_prefix = var.consistency_level == "BoundedStaleness" ? 100000 : null
}
geo_location {
failover_priority = 0
location = var.location
zone_redundant = false
}
geo_location {
location = var.secondary_location
failover_priority = 1
}
dynamic "capabilities" {
for_each = var.capability != null ? [var.capability] : []
content {
name = var.capability
}
}
analytical_storage {
schema_type = var.analytical_storage_schema
}
}