Terraform

There is a variable called "values" with the following value: ["mario", "luigi", "peach"]. How to create an output variable with the string value of the items in the list: "mario, luigi, peach," ?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

output "users" {
  value = "%{ for name in var.values }${name}, %{ endfor }"
}