0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

Last updated at Posted at 2013-05-22

対象: aws-sdk 1.9.5
すごくつまらないことでハマり続けたエラー
config.ymlにこのように記述してしまうと、
AWS::S3.newして、bucketのメソッドを呼び出すと
タイトルのエラーメッセージが発生する。

config.yml
access_key_id: "<YOUR_ACCESS_KEY_ID>"
secret_access_key: "<SECRET_ACCESS_KEY>"
region: "ap-northeast-1"
s3_host_name:  "s3-ap-northeast-1.amazonaws.com"
s3.rb
s3 = AWS::S3.new

policy = AWS::S3::Policy.new
bucket_name = "mybuckets"
bucket = s3.buckets["#{bucket_name}"]
puts bucket.policy.to_json
ruby-1.9.3-p327/gems/aws-sdk-1.9.5/lib/aws/core/client.rb:360:in `return_or_raise': The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. (AWS::S3::Errors::PermanentRedirect)

対応方法

config.ymlのregion/s3_host_nameを削除する。
AWS.config()に食わす方法を変える。

('A`)y-~

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?