Skip to content

Commit

Permalink
Update outputs.tf
Browse files Browse the repository at this point in the history
Fix the public_ip output to show IP address when eip is disabled and associated public IP is enabled.
  • Loading branch information
MartinCanovas authored Sep 19, 2020
1 parent cfebd60 commit 1fc2ad7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ output "az" {
}

output "public_ip" {
value = coalesce(aws_eip.default.*.public_ip, aws_instance.default.*.public_ip)
value = concat(aws_eip.default.*.public_ip, aws_instance.default.*.public_ip, [""])[0]
description = "Public IP of instance (or EIP)."

}
Expand Down Expand Up @@ -54,4 +54,4 @@ output "subnet_id" {
output "instance_count" {
value = var.instance_count
description = "The count of instances."
}
}

0 comments on commit 1fc2ad7

Please sign in to comment.