Simple flatten
Terraform function example and it’s usage in
various Terraform blocks.
Declare a local map
Local map variable with nested list of data.
Use flatten
function
Using for loops, convert the local variable into a list of name value pairs.
Run terraform plan
and you will see a flat map structure along with original map.