- Newest
- Most votes
- Most comments
To make your existing DynamoDB tables disaster recovery ready without causing drift in your CloudFormation managed resources, you can follow this approach:
-
Set the deletion policy to "Retain" for your existing AWS::DynamoDB::Table resources in your CloudFormation template. This ensures the table isn't deleted when you remove it from the stack.
-
Remove the table from your CloudFormation stack by updating your template to no longer include the table resource.
-
Convert the standalone table to a global table using the AWS Management Console or AWS CLI.
-
Import the newly created global table back into your CloudFormation stack as an AWS::DynamoDB::GlobalTable resource.
When defining your global table in CloudFormation, remember that each global table should be controlled by a single stack in a single region, regardless of how many replicas you have. You should not deploy the same AWS::DynamoDB::GlobalTable resource in multiple regions.
You can also enable deletion protection for your global tables by adding the "DeletionProtectionEnabled: true" property in the Replicas section of your AWS::DynamoDB::GlobalTable resource definition.
Sources
Global tables FAQ - AWS Prescriptive Guidance
Enable Deletion Protection on DynamoDb Globaltables using Cloudformation YAML | AWS re:Post
answered a year ago
Relevant content
asked a month ago
asked 4 years ago
