I have a simple terraform code to create eip.This works fine.
resource "aws_eip" "envoy" {
count = length(var.subnet_cidr_public)
vpc = true
tags = "${merge(map("Name","envoyadmin-${count.index}"),var.tags)}"
}
output "envoy_eip" {
description = "Elastic ip address for Envoy nlb services"
value = aws_eip.envoy.*.allocation_id
}
The problem I have is with the terraform output.Eventhough the eips are created in AWS account, the allocation_ids are shown as null in terraform output. What could be the issue with this and how to fix it?
terraform output
envoy_eip = [
null,
null,
null,
]
The allocation_id is actually now provided through id as explained in the github issue. Thus, you should have:
output "envoy_eip" {
description = "Elastic ip address for Envoy nlb services"
value = aws_eip.envoy.*.id
}
Also this is only id, not "Elastic ip address" as you wrote in description. For public IP you need to use:
output "envoy_eip" {
description = "Elastic ip address for Envoy nlb services"
value = aws_eip.envoy.*.public_ip
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With