- Newest
- Most votes
- Most comments
To my understanding, based on AWS IAM evaluation logic and documented Amazon RDS capabilities, here are the answers to your constraints:
1. Context during Creation
During the dependent rds:AddTagsToResource check at creation time, the resource does not yet exist. Therefore, aws:ResourceTag evaluates to null. If your IAM policy requires specific aws:ResourceTag values to allow rds:AddTagsToResource, the CreateDBInstance request will be denied. aws:RequestTag and aws:TagKeys will contain the tags passed in the initial creation request.
2. Creation-Only Discriminator
RDS does not support a creation-only tag discriminator. Unlike Amazon EC2, which provides the ec2:CreateAction condition key to strictly isolate tag-on-create authorizations, RDS lacks an equivalent context key. You cannot natively allow rds:AddTagsToResource solely during creation using IAM conditions.
Alternative Control: Enforce the exact ARN and aws:RequestTag rules for creation in IAM, but rely on AWS Config (detective) or SCPs (preventative) to prevent unauthorized tag modifications post-creation.
3. CloudFormation System Tags
CloudFormation automatically injects its system tags (aws:cloudformation:stack-id, etc.) into the API request. These keys are evaluated in the aws:TagKeys condition. If you use ForAllValues:StringEquals on aws:TagKeys and restrict it exclusively to your six application keys, the CreateDBInstance request will fail. You must explicitly allow the aws:cloudformation:* keys in your aws:TagKeys allowlist.
Verified Official AWS Documentation Links
Relevant content
asked 2 years ago
