Remediation
To reduce operational costs, migrate DynamoDB tables from higher-cost regions to more cost-efficient alternatives. DynamoDB does not support direct table moves across regions. The recommended approaches are:
- DynamoDB Global Tables
- Point-in-Time Recovery (PITR)
Migrate Using DynamoDB Global Tablesβ
- Enable streams on the existing table:
aws dynamodb update-table \
--table-name {{table-name}} \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
- Add replication to a new region:
aws dynamodb update-table --table-name {{table-name}} --cli-input-json \
'{
"ReplicaUpdates":
[
{
"Create": {
"RegionName": "{{target-region}}"
}
}
]
}' \
--region region
- Once data is synchronized, update applications to use the new region and optionally remove the old replica:
aws dynamodb update-table --table-name {{table-name}} --cli-input-json \
'{
"ReplicaUpdates":
[
{
"Delete": {
"RegionName": "{{source-region}}"
}
}
]
}' \
--region us-east-2
Note: Validate application functionality and data integrity before decommissioning the original table.
Migrate Using Point-in-Time Recovery (PITR)β
- Enable PITR on the source table (if not already enabled):
aws dynamodb update-continuous-backups \
--table-name {{table-name}} \
--point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
- Restore the table to a new table in the target region using PITR:
aws dynamodb restore-table-to-point-in-time \
--source-table-name {{table-name}} \
--target-table-name {{new-table-name}} \
--use-latest-restorable-time \
--region {{target-region}}
-
Update applications or services to point to the new table in the target region.
-
Decommission the original table once migration is validated:
aws dynamodb delete-table \
--table-name {{table-name}} \
--region {{source-region}}
Note: Validate application functionality and data integrity before decommissioning the original table.