Created
February 27, 2025 11:45
-
-
Save soerenmartius/c2e2e156cbc6a03cbc35cd0dbd673789 to your computer and use it in GitHub Desktop.
conditional code generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
globals { | |
generate_data_source_google_ip = true | |
} | |
generate_hcl "terramate_data.tf" { | |
lets { | |
condition = tm_try(global.generate_data_source_google_ip, true) | |
} | |
content { | |
tm_dynamic "resource" { | |
for_each = tm_toset(["domain"]) | |
iterator = value | |
labels = ["dns_a_record_set", value.value] | |
content { | |
host = tm_ternary(true, "google.com", "facebook.com") | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment