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 個月前檢視次數 165 次
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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南