A copy of aws cli between S3 regions on EC2

I am trying to copy between two S3 buckets in different regions using the command line interface on the EC2 server.

region information:
Instance EC2: us-west-2
S3 origin: us-east-1
S3: us-west-2

The following commands work perfectly with the EC2 server:
aws s3 cp s3://n-virginia/origin s3://n-virginia/destination --recursive --source-region us-east-1 --region us-east-1 --profile my_profile

aws s3 cp s3://oregon/origin s3://oregon/destination --recursive --source-region us-west-2 --region us-west-2 --profile my_profile

I need to run the following command from EC2 server:
aws s3 cp s3://n-virginia/origin s3://oregon/destination --recursive --source-region us-east-1 --region us-west-2 --profile my_profile

If I run this command from the local machine, it works, but if I run it from the EC2 server, which I used for the previous two commands, I get the following error:

Error: "A client error (AccessDenied) occurred when calling the CopyObject operation: VPC endpoints do not support cross-region requests"

EC2, EC2 , . , , EC2 ( "my_profile" )

+4

Source: https://habr.com/ru/post/1655865/


All Articles