[AWS] aws s3 sync ./upload_dir s3://xxx --region ap-northeast-1

Tadashi Shigeoka ·  Sun, April 20, 2014

When I tried to upload files to S3 from the command line using aws-cli, an error occurred.

AWS | Amazon Web Services
% aws s3 sync ./upload_dir s3://backetname

Error message

A client error (PermanentRedirect) occurred when calling the ListObjects operation: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

The cause was that I hadn’t set the region in the default configuration and hadn’t specified it as an option either.

aws s3 sync ./upload_dir s3://backetname --region ap-northeast-1

I was able to upload by specifying the S3 region I’m using, such as —region ap-northeast-1.

That’s all from the Gemba.