I want to get the Public Ip in a Network Interface via Terraform. the output of the NI show me the following json:
+ app_lb_ips = [
+ {
+ association = [
+ {
+ allocation_id = ""
+ association_id = ""
+ carrier_ip = ""
+ customer_owned_ip = ""
+ ip_owner_id = "amazon-elb"
+ public_dns_name = "ec2-3cxxxxxxx.compute.amazonaws.com"
+ public_ip = "3.xx.xx.50"
},
]
}
]
I tryied data.aws_network_interface.my_ni.*.association..public_ip but I get a error.
Error: Unsupported attribute
│
│ on modules/folder/outputs.tf line 33, in output "app_lb_ips":
│ 33: value = data.aws_network_interface.my_lb.*.association[0].public_dns_name
│ ├────────────────
│ │ data.aws_network_interface.my_lb is tuple with 2 elements
│
│ This value does not have any attributes.
Any ideas or suggestions? Thanks in advance