aws-route53: restrict domain names in cross-account delegation #28078
Labels
@aws-cdk/aws-route53
Related to Amazon Route 53
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p3
Describe the feature
IHostedZone has a convenient grantDelegation() method for granting an IAM role the necessary permissions for cross-account delegation. I would like to be able to restrict the names of the
NS
records that the grantee role canUPSERT
andDELETE
.Use Case
Take the following infrastructure:
example.com
beta.example.com
prod.example.com
I want to make sure that the IAM role assumed from the Beta account can only
UPSERT
andDELETE
theNS
recordbeta.example.com
and notprod.example.com
. This way I can be certain that if the Beta account is compromised, there will be no impact to the production domain.Proposed Solution
Add a backwards compatible parameter to grantDelegation() that would allow a user to optionally add this restriction. For example:
Internally, the grant would add the route53:ChangeResourceRecordSetsNormalizedRecordNames condition key with the specified names.
The
DelegationGrantNames
is a new class that allows the user to specify exact name matching (i.e.ForAllValues:StringEquals
) or pattern matching (i.e.ForAllValues:StringLike
). It's design would be based on the pattern used by aws-cdk-lib » aws_dynamodb » Billing:For example:
Other Information
No response
Acknowledgements
CDK version used
2.110.0
Environment details (OS name and version, etc.)
Apple Silicon / macOS 14.1.1 / nodejs 20.9.0
The text was updated successfully, but these errors were encountered: