Created
January 31, 2017 00:43
-
-
Save tom-butler/41fb533e89032f0f3e48d539f2098607 to your computer and use it in GitHub Desktop.
Terraform to only reference the resource that exists
This file contains 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
# Assuming either name_1 or name_2 exists (using a count = 0) | |
# The following can be used to pass an attribute from the resource that was created | |
"${coalesce( | |
join("", resource.name.*.id), | |
join("", resource.name_2.*.id) | |
)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment