Issue with Exporting ElastiCache Snapshot to S3 in the Same Region via CLI

0

Hello AWS Community,

I'm experiencing an issue while trying to export an ElastiCache snapshot to an S3 bucket, both of which are located in the eu-west-1 region. I have successfully taken a backup of my ElastiCache instance and created a new S3 bucket in the same region for the purpose of exporting this backup.

To ensure proper access, I've added the necessary ACL(540804c33a284a299d2547575ce1010f2312ef3da9b3a053c8bc45bf233e4353) and provided 'List' and 'Write' permissions to objects within the bucket. The ACL for the bucket is set to 'Read' and 'Write'. However, when I attempt to export the backup to S3 using the AWS CLI with the following command:

aws elasticache copy-snapshot --source-snapshot-name dump --target-snapshot-name dump-test --target-bucket s3://test.co.test.backup/

I encounter the following error:

An error occurred (InvalidParameterValue) when calling the CopySnapshot operation: The S3 bucket s3://test.co.test.backup/ is outside of the current Region, eu-west-1. Snapshot must be exported to the same region.

This error perplexes me, especially since I can export the snapshot to the S3 bucket without any issues when using the AWS Management Console. Given that both the ElastiCache instance and the S3 bucket are in eu-west-1, I'm unsure why the CLI is reporting a region mismatch.

Has anyone else faced a similar issue or can offer insight into why this error might be occurring via the CLI, despite the console operations working as expected? Any guidance or suggestions to resolve this discrepancy would be greatly appreciated.

Thank you for your help!

2개 답변
3

@Riku_Kobayashi Thanks for the help. After burning 4-5 hrs I managed to find the issue. It should have mentioned in the document I was using

--target-bucket s3://test.co.test.backup/ 

but the working command is

--target-bucket test.co.test.backup

no need to add s3://

답변함 2달 전
profile picture
전문가
검토됨 2달 전
1

Hello.

How about adding "--region eu-west-1" to the command option?
As far as I can see from the following document, there seems to be no problem with the command itself.
By the way, you're not using ElastiCache serverless, right?
If you are using ElastiCache serverless, you must use "export-serverless-cache-snapshot".
I also recommend that you review your S3 settings just to be sure.
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html#backups-exporting-grant-access

profile picture
전문가
답변함 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠