0
votes

I am trying to run the following command:

aws s3 cp --region ap-south-1 --acl public-read my.exe s3://bucket/binaries/my.exe

upload failed: ./my.exe to s3://bucket/binaries/my.exe A client error (InvalidRequest) occurred when calling the PutObject operation: You are attempting to operate on a bucket in a region that requires Signature Version 4. You can fix this issue by explicitly providing the correct region location using the --region argument, the AWS_DEFAULT_REGION environment variable, or the region variable in the AWS CLI configuration file. You can get the bucket's location by running "aws s3api get-bucket-location --bucket BUCKET".

How do I fix this error? I also tried the

AWS_DEFAULT_REGION=ap-south-1 aws s3 cp --acl public-read my.exe s3://bucket/binaries/my.exe

but with no luck.

# aws --version
aws-cli/1.10.28 Python/2.7.9 Linux/3.16.0-4-amd64 botocore/1.4.19
1
Can you add the output from aws --version to your question?Mark B
Added my version number. I am using Debian jessie.codefx

1 Answers

2
votes

It seems to be working after upgrading awscli.

pip install --upgrade awscli

aws --version
aws-cli/1.10.43 Python/2.7.9 Linux/3.16.0-4-amd64 botocore/1.4.33