Skip to content

Commit 4a4a0f7

Browse files
committed
Fix FQDN detection when using an existing ALB
When using an existing ALB, module.alb isn't fully populated, and referencing the Route 53 records fails. The error is caught by the top-level try, leaving atlantis_url empty. With this change, wrapping the reference to module.alb.route53_records in a try, var.atlantis.fqdn is used even when using an existing ALB. Fixes #377.
1 parent f983fd8 commit 4a4a0f7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

examples/github-separate/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module "atlantis" {
6767
valueFrom = try(module.secrets_manager["github-webhook-secret"].secret_arn, "")
6868
},
6969
]
70+
fqdn = module.alb.dns_name
7071
}
7172

7273
service = {

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ locals {
22
# Atlantis
33
atlantis_url = "https://${try(coalesce(
44
try(var.atlantis.fqdn, null),
5-
module.alb.route53_records["A"].fqdn,
5+
try(module.alb.route53_records["A"].fqdn, null),
66
module.alb.dns_name,
77
), "")}"
88

0 commit comments

Comments
 (0)