Skip to content

Commit

Permalink
fix: Ensure correct cluster or db resource pattern is added to rds:Ad…
Browse files Browse the repository at this point in the history
…dTagsToResource action (#111)

Fixes #110
  • Loading branch information
MauriceButler authored Apr 26, 2024
1 parent 79c6144 commit b0dbf79
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class RdsSanitizedSnapshotter extends Construct {
// needed for creating a snapshot with tags
this.snapshotter.addToRolePolicy(new iam.PolicyStatement({
actions: ['rds:AddTagsToResource'],
resources: [this.tempSnapshotArn, this.targetSnapshotArn, this.tempDbClusterArn],
resources: [this.tempSnapshotArn, this.targetSnapshotArn, this.tempDbClusterArn, this.tempDbInstanceArn],
}));

// key permissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
}
}
},
"77c4d732ada8ebcce7500544251e21c9286d5c95eef46636cafee5a21016e225": {
"4d342d6a3f6400ba76ff90f4cd6140b4d7b6f7a8a8c14189a2b75f634544caac": {
"source": {
"path": "RDS-Sanitized-Snapshotter-SFN.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "77c4d732ada8ebcce7500544251e21c9286d5c95eef46636cafee5a21016e225.json",
"objectKey": "4d342d6a3f6400ba76ff90f4cd6140b4d7b6f7a8a8c14189a2b75f634544caac.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,26 @@
":cluster:sanitize-*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":rds:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":db:sanitize-*"
]
]
}
]
}
Expand Down Expand Up @@ -3016,6 +3036,26 @@
":cluster:sanitize-*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":rds:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":db:sanitize-*"
]
]
}
]
}
Expand Down Expand Up @@ -4549,6 +4589,26 @@
":cluster:sanitize-*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":rds:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":db:sanitize-*"
]
]
}
]
},
Expand Down Expand Up @@ -6216,6 +6276,26 @@
":cluster:sanitize-*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":rds:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":db:sanitize-*"
]
]
}
]
},
Expand Down

0 comments on commit b0dbf79

Please sign in to comment.