This error occurs when you attempt to add a replica to a DynamoDB global table in a region where one already exists. Each global table can only have one replica per AWS region. Resolve this by checking existing replicas or removing orphaned ones before recreating.
The ReplicaAlreadyExistsException indicates that the specified replica is already part of the global table. DynamoDB enforces a constraint that each global table can have only one replica table per AWS region. When you attempt to create or add a replica in a region that already has an active replica for the specified global table, DynamoDB rejects the operation to prevent conflicts and data duplication. This error commonly occurs when working with the CreateGlobalTable or UpdateGlobalTable APIs, or when trying to convert an existing table into a global table without properly checking for existing replicas.
Use the AWS CLI to see which regions already have replicas for your table:
aws dynamodb describe-global-table \
--global-table-name your-table-name \
--region us-east-1Look at the ReplicationGroup output to see all active replicas. Each region should appear only once.
If you deleted a global table previously, its replicas might persist as standalone tables in other regions. Check each region:
aws dynamodb list-tables --region eu-west-1
aws dynamodb list-tables --region ap-southeast-1
# Check all regions where you intended to have replicasIf you find orphaned tables with the same name as your global table, they need to be deleted before recreating the global table.
If you found orphaned replica tables from a previous global table setup, delete them:
aws dynamodb delete-table \
--table-name your-table-name \
--region eu-west-1
aws dynamodb delete-table \
--table-name your-table-name \
--region ap-southeast-1Wait for all orphaned tables to be completely deleted before proceeding (this can take a few seconds).
Before adding a new replica, confirm the target region is not already in the global table:
aws dynamodb describe-global-table \
--global-table-name your-table-name \
--region us-east-1 | grep -A 5 ReplicationGroupIf the region you want to add is already listed, you do not need to add it again.
Use separate API calls for better reliability. First update to add a new replica:
aws dynamodb update-global-table \
--global-table-name your-table-name \
--replica-updates '[
{
"Create": {
"RegionName": "eu-west-1"
}
}
]' \
--region us-east-1AWS recommends issuing separate requests for adding or removing replicas instead of combining both operations in a single call.
If you are using the current version of global tables (2019.11.21), the UpdateTable API provides a simpler approach:
aws dynamodb update-table \
--table-name your-table-name \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \
--region us-east-1Then add replicas to the table definition. This is more flexible and consumes less write capacity than the legacy API.
Global Table Versions: DynamoDB has two versions of global tables. Version 2019.11.21 (Current) is recommended for new tables as it provides greater flexibility, higher efficiency, and consumes less write capacity than version 2017.11.29 (Legacy). If you are still using the legacy version, consider upgrading.
Replica Requirements: When adding a replica to a global table, each replica table must be empty, have the same primary key schema as other replicas, have DynamoDB Streams enabled with both new and old item images, and have the same provisioned write capacity units.
Quota Limits: Each AWS account has quotas for the number of global table replicas per region. If you encounter quota limit errors while adding replicas, create a case in the AWS Support Center to request an increase. The limit cannot be increased through the Service Quotas console.
Concurrent Operations: Do not attempt to add or remove replicas while another replication operation is in progress. Wait for the previous operation to complete fully before issuing the next UpdateGlobalTable command.
ImportConflictException: There was a conflict when attempting to import to the table
How to fix 'ImportConflictException: There was a conflict when attempting to import to the table' in DynamoDB
ResourceNotFoundException: Requested resource not found
How to fix "ResourceNotFoundException: Requested resource not found" in DynamoDB
TrimmedDataAccessException: The requested data has been trimmed
How to fix "TrimmedDataAccessException: The requested data has been trimmed" in DynamoDB Streams
GlobalTableNotFoundException: Global Table not found
How to fix "GlobalTableNotFoundException: Global Table not found" in DynamoDB
InvalidExportTimeException: The specified ExportTime is outside of the point in time recovery window
How to fix "InvalidExportTimeException: The specified ExportTime is outside of the point in time recovery window" in DynamoDB