Moving cosmosdb quickstart code to samples repo
This commit is contained in:
32
quickstart/101-cosmos-db-azure-container-instance/main.tf
Normal file
32
quickstart/101-cosmos-db-azure-container-instance/main.tf
Normal file
@ -0,0 +1,32 @@
|
||||
resource "random_pet" "rg_name" {
|
||||
prefix = var.resource_group_name_prefix
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "rg" {
|
||||
location = var.resource_group_location
|
||||
name = random_pet.rg_name.id
|
||||
}
|
||||
|
||||
resource "random_integer" "ri" {
|
||||
min = 10000
|
||||
max = 99999
|
||||
}
|
||||
|
||||
resource "azurerm_cosmosdb_account" "vote_cosmos_db" {
|
||||
name = "tfex-cosmos-db-${random_integer.ri.result}"
|
||||
location = azurerm_resource_group.rg.location
|
||||
resource_group_name = azurerm_resource_group.rg.name
|
||||
offer_type = "Standard"
|
||||
kind = "GlobalDocumentDB"
|
||||
|
||||
consistency_policy {
|
||||
consistency_level = "BoundedStaleness"
|
||||
max_interval_in_seconds = 10
|
||||
max_staleness_prefix = 200
|
||||
}
|
||||
|
||||
geo_location {
|
||||
location = azurerm_resource_group.rg.location
|
||||
failover_priority = 0
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user