Skip to content

fix: Allow empty string as Route53 record name #420

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

birjj
Copy link

@birjj birjj commented Jul 7, 2025

Description

Changes the way the Route53 record names are calculated, so they now align with the documentation. See #415 for further details on the background for this change.

Motivation and Context

If you want Atlantis to be hosted under the same FQDN as the Route53 zone under which it is registered, the Route53 record must be created with empty string ("") as its name. Unfortunately the current way the code works doesn't allow this (see #415): passing an empty string as var.route53_record_name would result in coalesce("", var.name) which would result in var.name. There was no way to explicitly specify empty string as the Route53 record name.

This PR rewrites the logic so the name now falls back to var.name iff var.route53_record_name == null (which is the default). If the caller explicitly sets route53_record_name = "", then that will be used instead as the Route53 record name.

Note that this aligns with the way the documentation for the route53_record_name input is written. The previous behavior was a bug, that made the implemented behavior not act as the documentation describes. This PR simply fixes the bug.

Fixes #415

Breaking Changes

Technically this is a breaking change; it changes what resources a given input spins up. This change is made to align it with the documentation, though, so there is no breaking change for documented behavior.

Whether you consider that a breaking change is up to the project maintainers.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

This has been tested locally to give the correct result. Since this is a niché use case (creating the Route53 record under the same name as the zone), I don't feel it relevant to add it to the examples/* documentation. That would likely just muddle the communication that the examples provide.

I have only copied out the locals block into a local TF project, and verified that the result is as intended. That is, I haven't spun up the module, made the changes, and verified that there are no infrastructure changes. This PR is intended as the next step up from #415 - the cost involved in verifying that there are no changes is too big for me to validate it thoroughly. Feel free to reject this PR if that is unacceptable.

This follows the documentation, which says:
'If null is specified, var.name is used instead.
Provide empty string to point root domain name to ALB.'
@birjj birjj changed the title fix: allow empty string as Route53 record name fix: Allow empty string as Route53 record name Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

route53_record_name doesn't support empty string
1 participant