Skip to content

ATLANTIS_ATLANTIS_URL not correctly picked up from atlantis.fqdn #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
MrPiao opened this issue Nov 30, 2023 · 3 comments
Closed
1 task done

ATLANTIS_ATLANTIS_URL not correctly picked up from atlantis.fqdn #377

MrPiao opened this issue Nov 30, 2023 · 3 comments

Comments

@MrPiao
Copy link

MrPiao commented Nov 30, 2023

Description

I am initializing the terraform-aws-atlantis module with the DNS records for the ALB manually configured (the domain we want is managed outside of Route53). To ensure local.atlantis_url is correctly set within the module, I am trying to set var.atlantis.fqdn to the correct URL; however, when I run terraform plan, the env variable for ATLANTIS_ATLANTIS_URL is set to just https://.

I have worked around this issue by defining another env variable with ATLANTIS_ATLANTIS_URL => url we want, but this is not ideal as AWS squashes the two env variables together, resulting in terraform plan always indicating that there is a change to made despite there not being a code change.

Relevant LOC:

try(var.atlantis.fqdn, null),

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 4.0.3

  • Terraform version: 1.6.3

  • Provider version(s): aws 5.28.0

Reproduction Code [Required]

module "atlantis" {
  source  = "terraform-aws-modules/atlantis/aws"
  version = "4.0.3"

  ...

  # ECS Container Definition
  atlantis = {
    fqdn  = "foobar.com"
    image = "ghcr.io/runatlantis/atlantis:v0.26.0"
    ...
  }

  ...

  create_certificate = false
  create_route53_records = false
}

Expected behavior

Env variable ATLANTIS_ATLANTIS_URL should be set to "https://foobar.com"

Actual behavior

Plan output (only relevant parts included)

      ~ container_definitions    = jsonencode(
          ~ [
              ~ {
                  ~ environment            = [
                      + {
                          + name  = "ATLANTIS_ATLANTIS_URL"
                          + value = "https://"
                        },
                        # (8 unchanged elements hidden)
                    ]
@remiflament
Copy link

Hello,
Did you test this issue with the last version of the module? 4.0.5

This local env should do the job

atlantis_url = "https://${try(coalesce(
    try(var.atlantis.fqdn, null),
    module.alb.route53_records["A"].fqdn,
    module.alb.dns_name,
  ), "")}"

On my tests I'm using the creation of the ACM and the record, and it works like a charm. If you need a code example with these, please let me know.

legoscia added a commit to GameAnalytics/terraform-aws-atlantis that referenced this issue Dec 7, 2023
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 each reference to module.alb in a try,
var.atlantis.fqdn is used even when using an existing ALB.

Fixes terraform-aws-modules#377.
legoscia added a commit to GameAnalytics/terraform-aws-atlantis that referenced this issue Dec 7, 2023
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 each reference to module.alb in a try,
var.atlantis.fqdn is used even when using an existing ALB.

Fixes terraform-aws-modules#377.
legoscia added a commit to GameAnalytics/terraform-aws-atlantis that referenced this issue Dec 10, 2023
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 terraform-aws-modules#377.
legoscia added a commit to GameAnalytics/terraform-aws-atlantis that referenced this issue Dec 11, 2023
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 terraform-aws-modules#377.
@bryantbiggs
Copy link
Member

resolved in #379

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants