I have the Terraform output of the module look like below:
ec2_multiple_instances = {
"one" = {
"private_dns" = "aaaaa.bbbb.cccc"
"private_ip" = "xx.xx.xx.xx"
"public_dns" = "ec2-xx-xx-xx-xx.compute.amazonaws.com"
"public_ip" = "xx.xx.xx.xx"
"spot_bid_status" = ""
"spot_instance_id" = ""
"spot_request_state" = ""
}
"two" = {
"private_dns" = "xxxxx.yyyyy.zzzzz"
"private_ip" = "yy.yy.yy.yy"
"public_dns" = "ec2-yy-yy-yy-yy.compute.amazonaws.com"
"public_ip" = "yy.yy.yy.yy"
"spot_bid_status" = ""
"spot_instance_id" = ""
"spot_request_state" = ""
}
}
I would like to get the public_ip values as example:
ec2_one_public_ip = module.ec2_multiple_instances.one.public_ip # "xx.xx.xx.xx"
ec2_two_public_ip = module.ec2_multiple_instances.two.public_ip # "yy.yy.yy.yy"
My terraform version: v1.2.8
Do you have any idea?