Why is the AWS CLI showing “A client error (PermanentRedirect) occurred” when trying to access S3?

Problem:

When trying to access S3 via the AWS CLI tools, you’re able to get a list of buckets, but can’t do anything else without seeing a “PermanentRedirect” error:

$ aws s3 ls
2011-06-22 16:25:23 bucket1
2011-07-26 21:34:43 testbucket
2012-08-20 17:05:32 mybucket
$
$ aws s3 ls 's3://mybucket'
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.
$

Solution:

You need to specify the S3 region:

$ aws --region us-east-1 s3 ls 's3://mybucket/'
                           PRE stuff/
                           PRE otherstuff/
2013-12-20 20:25:49         32 test.txt
$
Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Twitter
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • StumbleUpon

Leave a Reply

Your email address will not be published. Required fields are marked *