Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dynamic resource creation with Terraform and CosmosDb Configuration Store
data "external" "clusters" {
program = ["python", "./cosmosdb_reader.py"]
query = {
cosmos_endpoint = var.endpoint
cosmos_key = var.primary_readonly_master_key
region = "centralus"
subscription_id = "00000000-0000-0000-0000-000000000000"
// CosmosDb query function
data_function = "get_region_peerings"
}
}
resource "azurerm_virtual_network_peering" "centralus_to_eastus" {
count = data.external.vnets.result.count
[...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment