-
Notifications
You must be signed in to change notification settings - Fork 4k
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
docs(route53): crossaccountrole scope-down guidance #28624
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e4088a5
[aws/aws-cdk] aws-route53: Include CrossAccountRole scope-down guida…
miiiak d0fc5c4
Adding formatting changes in order for code to compile.
miiiak 388edfa
Merge branch 'aws:main' into tjbryant
miiiak 4dcc961
Fixing tab inconsistency
miiiak b125243
Merge branch 'tjbryant' of https://github.com/miiiak/aws-cdk into tjb…
miiiak 417f7c6
Merge branch 'main' into tjbryant
miiiak 2593e96
Merge branch 'tjbryant' of https://github.com/miiiak/aws-cdk into tjb…
miiiak e235532
Merge branch 'main' into tjbryant
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,7 +182,7 @@ new route53.ARecord(this, 'ARecord', { | |
### Cross Account Zone Delegation | ||
|
||
If you want to have your root domain hosted zone in one account and your subdomain hosted | ||
zone in a diferent one, you can use `CrossAccountZoneDelegationRecord` to set up delegation | ||
zone in a different one, you can use `CrossAccountZoneDelegationRecord` to set up delegation | ||
between them. | ||
|
||
In the account containing the parent hosted zone: | ||
|
@@ -192,11 +192,39 @@ const parentZone = new route53.PublicHostedZone(this, 'HostedZone', { | |
zoneName: 'someexample.com', | ||
}); | ||
const crossAccountRole = new iam.Role(this, 'CrossAccountRole', { | ||
// The role name must be predictable | ||
roleName: 'MyDelegationRole', | ||
// The other account | ||
assumedBy: new iam.AccountPrincipal('12345678901'), | ||
}); | ||
// The role name must be predictable | ||
roleName: 'MyDelegationRole', | ||
// The other account | ||
assumedBy: new iam.AccountPrincipal('12345678901'), | ||
// You can scope down this role policy to be least privileged. | ||
// If you want the other account to be able to manage specific records, | ||
// you can scope down by resource and/or normalized record names | ||
inlinePolicies: { | ||
"crossAccountPolicy": new iam.PolicyDocument({ | ||
statements: [ | ||
new iam.PolicyStatement({ | ||
sid: "ListHostedZonesByName", | ||
effect: iam.Effect.ALLOW, | ||
actions: ["route53:ListHostedZonesByName"], | ||
resources: ["*"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: i want a comma here and in all other places that should have punctuation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ack, should be resolved. |
||
}), | ||
new iam.PolicyStatement({ | ||
sid: "GetHostedZoneAndChangeResourceRecordSet", | ||
effect: iam.Effect.ALLOW, | ||
actions: ["route53:GetHostedZone", "route53:ChangeResourceRecordSet"], | ||
// This example assumes the RecordSet subdomain.somexample.com | ||
// is contained in the HostedZone | ||
resources: ["arn:aws:route53:::hostedzone/HZID00000000000000000"], | ||
conditions: { | ||
"ForAllValues:StringLike": { | ||
"route53:ChangeResourceRecordSetsNormalizedRecordNames": [ | ||
"subdomain.someexample.com" | ||
] | ||
|
||
} | ||
} | ||
}) | ||
}); | ||
parentZone.grantDelegation(crossAccountRole); | ||
``` | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the formatting here is inconsistent with the rest of the doc in terms of tabs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I follow, I see other comments in the doc follow the tab alignment of the line of code below it that it speaks to. Can you clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is your rich diff. the tab alignment is off