Last active
March 8, 2020 00:05
-
-
Save karl-cardenas-coding/9a898590e200831f065ef19f41418949 to your computer and use it in GitHub Desktop.
For loop in Terraform
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
locals { | |
s3_ips = try(distinct([ #distinct() is not needed but added to showcase the wrap of functions before the loop | |
for items in jsondecode(data.http.primary-server.body).prefixes: | |
items.ip_prefix if items.service == "S3" | |
]), "NO LIST PROVIDED IN LOCALS S3_IPS VARIABLE") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment