-
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
DynamoDB: Global Table creation doesn't set retention policy for replica tables #25740
Comments
The replicas aren't created through Cfn, so this would need to be handled by the custom resource handler. Could potentially skip deleting some regions here
|
I'd also recommend creating a global table resource ( |
This issue was for the existing Instead, the Be aware that there are additional deployment steps involved in a migration from Here are some other resources to get you started (using
|
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Status
Investigating (Default)
What is the issue?
The level 2 Table construct creates global tables that are not in alignment with DynamoDB best practices (uses
Table
CFN resource + custom resources vs the GlobalTable CFN resource)This poses a serious risk of deleting the replicas if their retain policy was set up on the construct:
I used the above code to create my global tables. When I deleted the CF stack manually, root table was preserved as per removalpolicy, but all replicas were deleted.
This construct should adhere to dynamodb best practices and create a GlobalTable resource: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_reqs_bestpractices.html
Reference:
Documentation: https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/aws-dynamodb#amazon-dynamodb-global-tables
Code: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts
Error message
No response
What is the impact?
If Global tables are created this way, the replica tables retention policy won't be set. This means, the replica tables can be accidentally deleted despite what the code snippet suggests
Workaround
No response
Who is affected?
Anyone creating global tables based on this doc using this library
How do I resolve this?
Customers could use the level 1 CFNGlobalTable constuct as a workaround: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.CfnGlobalTable.html
Related issues
No response
The text was updated successfully, but these errors were encountered: