aws-cdk-lib/aws-dynamodb: replicationRegions generate lots of AccessDenied errors in CloudTrail log #22065
Labels
@aws-cdk/aws-dynamodb
Related to Amazon DynamoDB
bug
This issue is a bug.
ddb-legacy-table
This issue has to do with DynamoDB's legacy Table construct. Close after migration guide is out.
effort/medium
Medium work item – several days of effort
p3
Describe the bug
When deploying, updating dynamodb table with replica regions, I observe access denied errors in cloud trail log
Expected Behavior
No access denied errors in cloudtrail log
Current Behavior
Bunch of AccessDenied errors generated during creation of a global table, also when adding/removing replica region, or removing whole table.
There are no errors in lambda logs or cloudformation stack events. Table construct works well with global tables.
However, these access denied errors trigger alarms we have for CIS control 3.1
Reproduction Steps
coming from all replica regions
Possible Solution
onEventHandler has dynamodb permissions in replica regions, while isCompleteHandler does not:
aws-cdk/packages/@aws-cdk/aws-dynamodb/lib/table.ts
Line 1664 in 433a1fa
I suppose that the assumption was that calling DescribeTable in a region X will require only permissions in region X. However, it looks like AWS under the hood invokes DescribeTable in every replica region for global tables.
Additional Information/Context
No response
CDK CLI Version
2.38.1 (build a5ced21)
Framework Version
No response
Node.js Version
v14.20.0
OS
GNU/Linux
Language
Typescript
Language Version
4.7.4
Other information
No response
The text was updated successfully, but these errors were encountered: