From 1fc2ad71519efd616a2a18705f632a9b67e6db1a Mon Sep 17 00:00:00 2001 From: Martin Canovas Date: Sat, 19 Sep 2020 12:50:16 -0300 Subject: [PATCH 1/2] Update outputs.tf Fix the public_ip output to show IP address when eip is disabled and associated public IP is enabled. --- outputs.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outputs.tf b/outputs.tf index 0b4b8fe..6f9ee76 100644 --- a/outputs.tf +++ b/outputs.tf @@ -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)." } @@ -54,4 +54,4 @@ output "subnet_id" { output "instance_count" { value = var.instance_count description = "The count of instances." -} \ No newline at end of file +} From 87af9a5ded1c8185460cb2fe44280a5cab5c0851 Mon Sep 17 00:00:00 2001 From: Martin Canovas Date: Sat, 19 Sep 2020 22:57:58 -0300 Subject: [PATCH 2/2] Update outputs.tf Allow more than one public IP --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 6f9ee76..1d97e32 100644 --- a/outputs.tf +++ b/outputs.tf @@ -16,7 +16,7 @@ output "az" { } output "public_ip" { - value = concat(aws_eip.default.*.public_ip, aws_instance.default.*.public_ip, [""])[0] + value = concat(aws_eip.default.*.public_ip, aws_instance.default.*.public_ip, [""]) description = "Public IP of instance (or EIP)." }