Skip to content

Commit 8dda61f

Browse files
authored
Fix checks on var.zone_id in order to handle var.zone_id being null. (#83)
1 parent 46ef8ba commit 8dda61f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module "security_group" {
4040
}
4141

4242
data "aws_route53_zone" "domain" {
43-
count = module.this.enabled && var.zone_id != "" ? 1 : 0
43+
count = module.this.enabled && try(length(var.zone_id), 0) > 0 ? 1 : 0
4444
zone_id = var.zone_id
4545
}
4646

@@ -106,7 +106,7 @@ resource "aws_eip" "default" {
106106
module "dns" {
107107
source = "cloudposse/route53-cluster-hostname/aws"
108108
version = "0.12.0"
109-
enabled = module.this.enabled && var.zone_id != "" ? true : false
109+
enabled = module.this.enabled && try(length(var.zone_id), 0) > 0 ? true : false
110110
zone_id = var.zone_id
111111
ttl = 60
112112
records = var.associate_public_ip_address ? tolist([local.public_dns]) : tolist([join("", aws_instance.default.*.private_dns)])

0 commit comments

Comments
 (0)