https://www.terraform.io/docs/configuration/functions/formatlist.html
formatlist("%s/32", data.dns_a_record_set.google.addrs)
On Sat, Aug 31, 2019 at 6:52 PM Sidh <sidhur...@gmail.com> wrote:
>
> Need to get output in CIDR notation.
>
> data "dns_a_record_set" "google" {
> host = "www.google.com"
> }
>
> output "google" {
> value = ["${join("/32,", data.dns_a_record_set.google.addrs)}"]}
> }
>
> trying to get output as :
>
> ["1.2.3.4/32", "4.5.6.7/32"]
>
> instead getting output as [1.2.3.4/32, 5.6.7.8]
>
> So , no quotes and /32 missing in last value. Any suggestions ?
>
> Sidh
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/hashicorp/terraform/issues
> IRC: #terraform-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups "Terraform" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to terrafo...@googlegroups.com.