-
Notifications
You must be signed in to change notification settings - Fork 1
/
cosmosdb_sql_container_test.tf
139 lines (120 loc) · 4.1 KB
/
cosmosdb_sql_container_test.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
provider "azurerm" {
skip_provider_registration = true
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "eastus"
}
resource "azurerm_cosmosdb_account" "example" {
name = "tfex-cosmosdb-account"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
offer_type = "Standard"
analytical_storage_enabled = true
consistency_policy {
consistency_level = "Strong"
}
geo_location {
location = "westus"
failover_priority = 0
}
backup {
type = "Periodic"
interval_in_minutes = 240
retention_in_hours = 16
}
}
resource "azurerm_cosmosdb_account" "continuous_backup" {
name = "tfex-cosmosdb-account"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
offer_type = "Standard"
consistency_policy {
consistency_level = "Strong"
}
geo_location {
location = "westus"
failover_priority = 0
}
geo_location {
location = "centralus"
failover_priority = 1
zone_redundant = true
}
backup {
type = "Continuous"
}
}
resource "azurerm_cosmosdb_account" "multi-master_backup2copies" {
name = "tfex-cosmosdb-account"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
offer_type = "Standard"
enable_multiple_write_locations = true
consistency_policy {
consistency_level = "Strong"
}
geo_location {
location = "westus"
failover_priority = 0
}
geo_location {
location = "centralus"
failover_priority = 1
}
backup {
type = "Periodic"
}
}
resource "azurerm_cosmosdb_sql_database" "example" {
name = "tfex-cosmos-mongo-db"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.example.name
autoscale_settings {
max_throughput = 4000
}
}
resource "azurerm_cosmosdb_sql_container" "non-usage_autoscale" {
name = "example-container"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.example.name
database_name = azurerm_cosmosdb_sql_database.example.name
partition_key_path = "/definition/id"
autoscale_settings {
max_throughput = 4000
}
}
resource "azurerm_cosmosdb_sql_container" "autoscale" {
name = "example-container"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.continuous_backup.name
database_name = azurerm_cosmosdb_sql_database.example.name
partition_key_path = "/definition/id"
autoscale_settings {
max_throughput = 6000
}
}
resource "azurerm_cosmosdb_sql_container" "provisioned" {
name = "example-container"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.continuous_backup.name
database_name = azurerm_cosmosdb_sql_database.example.name
partition_key_path = "/definition/id"
throughput = 500
}
resource "azurerm_cosmosdb_sql_container" "mutli-master_backup2copies" {
name = "example-container"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.example.name
database_name = azurerm_cosmosdb_sql_database.example.name
partition_key_path = "/definition/id"
throughput = 1000
}
resource "azurerm_cosmosdb_sql_container" "serverless" {
name = "example-container"
resource_group_name = azurerm_cosmosdb_account.example.resource_group_name
account_name = azurerm_cosmosdb_account.example.name
database_name = azurerm_cosmosdb_sql_database.example.name
partition_key_path = "/definition/id"
}