-1

I have a terraform array/list

r53_zone_names = [
  "google.com.",
  "example.com.",
]

But I wish to convert it to sting for sending it to external-dns helm chart, it asks for such one:

"{google.com.,example.com.}"

How to do that with HCL? Terraform v1.3.7

ipeacocks
  • 2,187
  • 3
  • 32
  • 47

1 Answers1

2

Using format and join:

> format("{%s}",join(",",local.r53_zone_names))
"{google.com.,example.com.}"
Paolo
  • 21,270
  • 6
  • 38
  • 69