Search code examples
terraformhclzipmap

Append string to the map type in Terraform


I have a next expression in Terraform (v0.11.7):

my_expression = "${zipmap(random_shuffle.x.result, random_shuffle.x.result)}"

I need to append string to right expression, e.g:

my_expression = "${zipmap(random_shuffle.x.result, "*" + random_shuffle.x.result)}"

Do I have any solution for this? Thanks in advance


Solution

  • one way to achieve this would be as follows:

    my_expression = "${zipmap(random_shuffle.x.result,formatlist("*%s",random_shuffle.x.result))}"