-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
59 lines (49 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
provider "azurerm" {
version = "=1.38.0"
}
resource "azurerm_resource_group" "urban_noise_rg" {
name = "urbannoise-db-account-rg"
location = "West Europe"
}
resource "azurerm_cosmosdb_account" "urbannoise-db-account" {
name = "urbannoise-db-account"
resource_group_name = "${azurerm_resource_group.urban_noise_rg.name}"
location = "${azurerm_resource_group.urban_noise_rg.location}"
offer_type = "Standard"
kind = "MongoDB"
consistency_policy {
consistency_level = "BoundedStaleness"
max_interval_in_seconds = 300
max_staleness_prefix = 100000
}
geo_location {
location = "North Europe"
failover_priority = 1
}
geo_location {
location = "${azurerm_resource_group.urban_noise_rg.location}"
failover_priority = 0
}
}
resource "azurerm_cosmosdb_mongo_database" "urban-noise-db" {
name = "urban-noise-db"
resource_group_name = "${azurerm_cosmosdb_account.urbannoise-db-account.resource_group_name}"
account_name = "${azurerm_cosmosdb_account.urbannoise-db-account.name}"
}
resource "azurerm_cosmosdb_mongo_collection" "generic-components-collection" {
name = "generic-components"
resource_group_name = "${azurerm_cosmosdb_account.urbannoise-db-account.resource_group_name}"
account_name = "${azurerm_cosmosdb_account.urbannoise-db-account.name}"
database_name = "${azurerm_cosmosdb_mongo_database.urban-noise-db.name}"
default_ttl_seconds = "777"
shard_key = "uniqueKey"
throughput = 400
indexes {
key = "aKey"
unique = false
}
indexes {
key = "uniqueKey"
unique = true
}
}