
Exporting Amazon ElastiCache Backup to Amazon S3
Exporting ElastiCache backups to Amazon S3 ensures long-term storage, data portability, and integration with other AWS services.
Published Mar 19, 2025
Amazon ElastiCache is a fully managed in-memory data store service supporting Redis and Memcached. It provides automated backup functionality, enabling users to restore data in case of failures or migrate it to other environments. Exporting ElastiCache backups to Amazon S3 ensures long-term storage, data portability, and integration with other AWS services.
This guide outlines the steps to export an ElastiCache backup to an Amazon S3 bucket.
Before proceeding, ensure that you have:
- An Amazon ElastiCache Redis cluster (backups are not supported for Memcached).
- An Amazon S3 bucket for storing the backup.
- Appropriate IAM permissions to allow ElastiCache to write to the S3 bucket.
- AWS CLI or AWS Management Console access.
If you haven’t already, create an S3 bucket:
1. Navigate to the Amazon S3 console.
2. Click Create Bucket.
3. Provide a unique bucket name and choose a region.
4. Configure permissions as per your security requirements.
5. Click Create Bucket.
ElastiCache needs permissions to write backups to the S3 bucket.
Create a new policy with the following permissions:
Replace
backups-product
with your actual S3 bucket name.- Navigate to the IAM Console.
- Click Roles and select Create role.
- Choose AWS Service and select ElastiCache.
- Attach the policy you created.
- Complete the role creation and note the IAM Role ARN.
Using AWS CLI:
aws elasticache create-snapshot \
--cache-cluster-id your-cluster-id \
--snapshot-name
my-backupReplace
your-cluster-id
with your ElastiCache cluster ID.Using AWS Console:
1. Navigate to ElastiCache.
2. Select your Redis cluster.
3. Click Backups > Create Backup.
4. Enter a name and confirm.
Once the backup is created, export it to S3:
Replace:
-
your-bucket-name
with the target S3 bucket. -
your-account-id
with your AWS account ID. -
your-role-name
with the IAM role you created.The following Python script efficiently exports all Redis keys and values (including different data types) to Amazon S3:
- Deploy the script as an AWS Lambda function.
- Add IAM permissions to allow writing to S3.
- Schedule the Lambda function using CloudWatch Events.

For further details, refer to the AWS Documentation.
Exporting Amazon ElastiCache backups to S3 is essential for long-term data storage, disaster recovery, and migration purposes. By setting up the correct IAM permissions and following the outlined steps, you can seamlessly integrate ElastiCache with S3 for efficient backup management.