Repository navigation
feat(terraform): allow the Route 53 hosted zones in another account - #602
Merged
Merged
Conversation
Add an optional dns_role_arn. When set, the certificate-validation, app and auth Route 53 records are written through an aws.dns provider that assumes it, so the hosted zones can live in a central DNS account. Empty keeps the current behaviour: the deployment account's own credentials.
thenom
marked this pull request as ready for review
October 23, 2026 10:46
thenom
requested review from
JWThewes,
eipasteur,
jeromevdl,
leandrodamascena and
svozza
as code owners
October 23, 2026 10:46
JWThewes
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: None. Builds on #358 / #359
Description of changes:
Problem
route53_zone_idandauth_route53_zone_idmust name hosted zones in the deployment account. Many organisations keep their public hosted zones in a central DNS account, so they have to set the zone IDs to empty and manage the certificate-validation and alias records by hand.#359 handles a zone in another account through
acm_certificate_arnplus thedns_targetoutputs, which leaves the records to be published by hand. This PR adds an opt-in path for the case where that zone is Route 53 and the deployer can assume a role in its account; the existing paths are unchanged.Solution
dns_role_arnvariable, validated as an IAM role ARN or empty.aws.dnsprovider. It assumesdns_role_arnwhen set; otherwise it uses the deployment account's own credentials.aws.dns: certificate validation inmodules/domain, the app alias records and the auth alias records.modules/domaindeclares the new configuration alias.route53_zone_iddescription to say the zone may be in another account.The role in the DNS account needs permission to manage records in those zones (for example
route53:ChangeResourceRecordSets,route53:GetChange,route53:ListResourceRecordSetsandroute53:GetHostedZone) and a trust policy for the deploying principal.Testing
terraform fmt -check,terraform validate -no-testsand everyterraform testsuite from the Terraform workflow pass on Terraform 1.15.0 (auth-domain, waf, yjs, managed-environments, lambda-packaging). The SSO plan-privacy test also passes.dns_role_arnis set and the zone is reached through the assumed role.Impact
dns_role_arnempty, the records are created with the same credentials as before. The only plan difference is the provider address in state, which Terraform handles without replacing anything.extra_tags) merges too, the new provider should mergeextra_tagsinto itsdefault_tags. I'll update whichever lands second.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.