Skip to content

Instantly share code, notes, and snippets.

@identw
Created September 4, 2023 07:51
Show Gist options
  • Save identw/a4681b9faa00da3858d9784b9b507683 to your computer and use it in GitHub Desktop.
Save identw/a4681b9faa00da3858d9784b9b507683 to your computer and use it in GitHub Desktop.
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