Skip to content

Commit

Permalink
Fix checks on var.zone_id in order to handle var.zone_id being null. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
korenyoni authored Jul 9, 2021
1 parent 46ef8ba commit 8dda61f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module "security_group" {
}

data "aws_route53_zone" "domain" {
count = module.this.enabled && var.zone_id != "" ? 1 : 0
count = module.this.enabled && try(length(var.zone_id), 0) > 0 ? 1 : 0
zone_id = var.zone_id
}

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

0 comments on commit 8dda61f

Please sign in to comment.