Skip to content

feat(route53): support intermediate role for CrossAccountZoneDelegationRecord#36975

Open
cfoley220 wants to merge 1 commit intoaws:mainfrom
cfoley220:cfoley220/cross-account-zone-intermediate-role
Open

feat(route53): support intermediate role for CrossAccountZoneDelegationRecord#36975
cfoley220 wants to merge 1 commit intoaws:mainfrom
cfoley220:cfoley220/cross-account-zone-intermediate-role

Conversation

@cfoley220
Copy link

@cfoley220 cfoley220 commented Feb 12, 2026

Issue

No existing issue - this PR highlights a limitation and proposes a solution.

Reason for this change

The current CrossAccountZoneDelegationRecord construct requires the under-the-hood Custom Resource's Lambda execution role to directly assume the delegation role in the parent account. This limits flexibility for teams that need role chaining for various architectural reasons.

For my team specifically, managing zone delegation across hundreds of accounts has hit IAM trust policy size limits on the delegation role. Using an intermediate role as a single trust point solves this scaling issue. The usage of intermediate roles is a developed solution for our application to interface with other AWS accounts for other use-cases- without needing the other AWS accounts to maintain a list of hundreds of accounts. This PR allows usage for maintaining our R53 record.

Description of changes

Added optional intermediateRole parameter to CrossAccountZoneDelegationRecord that enables role chaining:

  1. Lambda assumes intermediate role
  2. Uses those credentials to assume delegation role
  3. Performs Route53 record update

Changes:

  • Added intermediateRole optional property to construct
  • Modified custom resource handler to chain role assumptions via masterCredentials
  • Updated IAM policy to grant permission to intermediate role when provided
  • Fully backward compatible (optional parameter)

Description of how you validated changes

  • Unit tests for with/without intermediate role scenarios
  • Successfully ran /bin/bash run-rosetta.sh for README changes
  • Updated integration tests
    • Successfully ran integ.zone-delegation-iam-stack.ts with --update-on-failed
    • NOTICE I was unable to run integ.cross-account-zone-delegation.ts from the cross-account specifics required. As such, I did not check in any snapshot changes. Can a maintainer run these tests?
    • As a stop gap, I successfully updated a CDK application I own to use the new handler code and an intermediate role. I verified by revoking access from the delegation role to my app's AWS account (while allowing access from the intermediate account).

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team February 12, 2026 15:28
@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Feb 12, 2026
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

@cfoley220
Copy link
Author

Clarification Request:

Per contributing guide, if integ tests are unable to be run, "please call this out on the pull request so a maintainer can run the tests for you". This is noted in PR description. Let me know if I should include resultant snapshots myself.

@aws-cdk-automation aws-cdk-automation added pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. labels Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants