Quantcast
Channel: Terraform - HashiCorp Discuss
Viewing all articles
Browse latest Browse all 11446

How to use for_each inside a terraform json configuration file

$
0
0

Hi,

I am having trouble escaping or passing along a set to the for_each function when using a terraform json config file.

I can do this in a terraform file and everything works as expected:

for_each = {for e in local.email_ids: e.emails => e}

Here is what i tried for json syntax:

“for_each”: “${for e in local.email_ids: e.emails => e}”

That is not working. here is the error message:

23: “for_each”: “${for e in local.email_ids: e.emails => e}”,

Expected a closing brace to end the interpolation expression, but found extra
characters.

Anyone know the magic sequence?

Thanks

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 11446

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>