Skip to content

Instantly share code, notes, and snippets.

@identw
Created September 4, 2023 08:10
Show Gist options
  • Save identw/b9c288abd5f5c8cbddff7b31715de043 to your computer and use it in GitHub Desktop.
Save identw/b9c288abd5f5c8cbddff7b31715de043 to your computer and use it in GitHub Desktop.
terramate example tm_dynamic how to generate few resources for each provider
globals {
providers = ["name1", "name2"]
}
generate_hcl "example.tf" {
content {
tm_dynamic "resource1" {
for_each = tm_toset(global.providers)
iterator = i
content {
provider = i.value
}
}
tm_dynamic "resource2" {
for_each = tm_toset(global.providers)
iterator = i
content {
provider = i.value
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment