Skip to content

Commit

Permalink
Handle empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
ppawlowski committed Aug 29, 2024
1 parent 2a1ee80 commit d2af033
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lb-domain/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ data "aws_lb" "ingress" {
}

data "aws_lb" "custom_domains_ingress" {
count = var.create_custom_domain_record ? 1 : 0
tags = {
Namespace = var.namespace
Stage = var.stage
Expand All @@ -25,14 +26,14 @@ locals {
}
]

custom_domain_dns_record = {
custom_domain_dns_record = var.create_custom_domain_record ? {
name = var.custom_domain_record_value
type = "CNAME"
ttl = 300
records = [
data.aws_lb.custom_domains_ingress.dns_name
data.aws_lb.custom_domains_ingress.0.dns_name
]
}
} : null

dns_records = concat(
local.main_dns_records,
Expand Down

0 comments on commit d2af033

Please sign in to comment.