This API provides functionality for taking bulk backups of DynamoDB tables and restoring them when needed. It leverages the AWS SDK and various npm packages to simplify the backup and restore process.
- Node.js installed on your machine
- AWS account with DynamoDB tables set up
- AWS access key and secret access key with appropriate permissions
- Clone the repository:
git clone https://github.com/jacksonkasi1/dynamodb-backup-restore.git
- Navigate to the project directory:
cd dynamodb-backup-restore
- Install dependencies:
npm install
- Rename
.env.example
to.env
. - Open
.env
file and update the following variables with your AWS credentials and desired settings:AWS_ACCESS_KEY_ID
: Your AWS access key ID.AWS_SECRET_ACCESS_KEY
: Your AWS secret access key.AWS_REGION
: The AWS region where your DynamoDB tables are located.AWS_BUCKET_NAME
: The name of the S3 bucket to store backups.
- Start the server:
npm start
- Use your preferred API testing tool (e.g., Postman) to send requests to the available endpoints:
POST /backup/table-list
: Takes a list of table names as input and creates backups for each table.POST /backup/table-all
: Creates backups for all tables in the DynamoDB.POST /restore/table-all
: Restores tables from JSON backup files stored in the specified S3 path.GET /bucket/download
: Downloads all objects from the specified S3 bucket and provides them as a zip file.POST /bucket/upload
: Uploads a zip file containing objects to the specified S3 bucket.
For detailed API documentation and example requests, refer to the Postman documentation.
For more insights and discussions related to restoring DynamoDB table backups using an API endpoint, check out our blog post on https://jacksonkasi1.hashnode.dev/restoring-dynamodb-table-backup-using-an-api-endpoint.
If you encounter any issues or have suggestions for improvements, please submit them on the GitHub Issues page.
This project is licensed under the ISC License.