Copy Amazon DynamoDB tables across accounts using AWS Backup
Created by Ramkumar Ramanujam (AWS)
Summary
When working with Amazon DynamoDB on Amazon Web Services (AWS), a common use case is to copy or sync DynamoDB tables in development, testing, or staging environments with the table data that is in the production environment. As a standard practice, each environment uses a different AWS account.
AWS Backup supports cross-Region and cross-account backup and restore of data for DynamoDB, Amazon Simple Storage Service (Amazon S3), and other AWS services. This pattern provides the steps for using AWS Backup cross-account backup and restore to copy DynamoDB tables between AWS accounts.
Prerequisites and limitations
Prerequisites
Two active AWS accounts that belong to the same AWS Organizations organization
DynamoDB tables in both the accounts.
AWS Identity and Access Management (IAM) permissions to create and use AWS backup vaults
Limitations
Source and target AWS accounts should be part of the same AWS Organizations organization.
Architecture
Target technology stack
AWS Backup
Amazon DynamoDB
Target architecture
Create the DynamoDB table backup in the AWS Backup backup vault in the source account.
Copy the backup to the backup vault in the target account.
Restore the DynamoDb table in the target account using the backup from the target account backup vault.
Automation and scale
You can use AWS Backup to schedule backups to run at specific intervals.
Tools
AWS Backup – AWS Backup is a fully-managed service for centralizing and automating data protection across AWS services, in the cloud, and on premises. Using this service, you can configure backup policies and monitor activity for your AWS resources in one place. It allows you to automate and consolidate backup tasks that were previously performed service-by-service, and removes the need to create custom scripts and manual processes.
Amazon DynamoDB – Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability.
Epics
Task | Description | Skills required |
---|---|---|
Turn on advanced features for DynamoDB and cross-account backup. | In both the source and the target AWS accounts, do the following:
| AWS DevOps, Migration engineer |
Task | Description | Skills required |
---|---|---|
Create backup vaults. | In both the source and the target AWS accounts, do the following:
The ARNs of both the source and the target backup vaults will be required when you copying the DynamoDB table backup between the source account and the target account. | AWS DevOps, Migration engineer |
Task | Description | Skills required |
---|---|---|
In the source account, create a DynamoDB table backup. | To create a backup for the DynamoDB table in the source account, do the following:
A new backup job is created. To monitor the status of the backup job, on the AWS Backup Jobs page, choose the Backup Jobs tab. All active, in-progress, and completed backup jobs are listed in this tab. | AWS DevOps, DBA, Migration engineer |
Copy the backup from the source account to the target account. | After the backup job is completed, copy the DynamoDB table backup from the backup vault in the source account to the backup vault in target account. To copy the backup vault, in the source account, do the following:
| AWS DevOps, Migration engineer, DBA |
Restore the backup in the target account. | In the target AWS account, do the following:
| AWS DevOps, DBA, Migration engineer |