Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Created February 27, 2025 11:51
Show Gist options
  • Save soerenmartius/483418127af11073c5c6fee483fe4b2b to your computer and use it in GitHub Desktop.
Save soerenmartius/483418127af11073c5c6fee483fe4b2b to your computer and use it in GitHub Desktop.
Fancy Generate
globals {
dns_record_sets = [
"google.com",
"facebook.com",
]
}
generate_hcl "terramate_data.tf" {
content {
tm_dynamic "resource" {
for_each = tm_toset(tm_try(global.dns_record_sets, []))
iterator = value
labels = ["dns_a_record_set", "domain"]
content {
host = value.value
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment