Skip to content

Instantly share code, notes, and snippets.

@stvdilln
Created January 14, 2021 17:38
Show Gist options
  • Save stvdilln/debc271840f3317c7e8fdf789993d37e to your computer and use it in GitHub Desktop.
Save stvdilln/debc271840f3317c7e8fdf789993d37e to your computer and use it in GitHub Desktop.
terraform-azurerm: Calling CosmosDB to create a container
module "cosmosdb_northwind_customers" {
source = "../../../submodules/terraform-azurerm/services/cosmos-db/container/v1"
context = module.coreinfra.context
service_settings = {
account_name = module.cosmosdb_account.name
database_name = module.cosmosdb_database.name
name = "customers"
partition_key_path = "/customerid"
}
}
resource "azurerm_cosmosdb_sql_container" "container" {
resource_group_name = var.context.resource_group_name
account_name = var.service_settings.account_name
database_name = var.service_settings.database_name
name = var.service_settings.name
partition_key_path = var.service_settings.partition_key_path
indexing_policy {
indexing_mode = "Consistent"
included_path {
path = "/*"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment