Me trataron de establecer la conexión a la cuenta de mi AWS S3 como éste en mi IRB consola -problema para acceder cubo de mi AWS S3 cuenta
AWS::S3::Base.establish_connection!(:access_key_id => 'my access key', :secret_access_key => 'my secret key', :server => "s3-ap-southeast-1.amazonaws.com")
Y funciona bien y rápido esto -
=> #<AWS::S3::Connection:0x8cd86d0 @options={:server=>"s3-ap-southeast-1.amazonaws.com", :port=>80, :access_key_id=>"my access key", :secret_access_key=>"my secret key"}, @access_key_id="my access key", @secret_access_key="my secret key", @http=#<Net::HTTP s3-ap-southeast-1.amazonaws.com:80 open=false>>
tengo un cubo que se basa en "Singapur Región" y para ese servidor de punto final es decir: s3-ap-southeast-1.amazonaws.com Así que cuando intento acceder a ella usando este comando -
AWS::S3::Service.buckets
se va a buscar todos los cubos en mi cuenta correctamente -
=> [#<AWS::S3::Bucket:0x8d291fc @attributes={"name"=>"bucket1", "creation_date"=>2011-06-28 10:08:58 UTC}, @object_cache=[]>,
#<AWS::S3::Bucket:0x8d291c0 @attributes={"name"=>"bucket2", "creation_date"=>2011-07-04 07:15:21 UTC}, @object_cache=[]>,
#<AWS::S3::Bucket:0x8d29184 @attributes={"name"=>"bucket3", "creation_date"=>2011-07-04 07:39:21 UTC}, @object_cache=[]>]
donde como bucket1 pertenece a Singapur Región 2 y otra a la Región de Estados Unidos. Por lo tanto, cuando hago esto -
AWS::S3::Bucket.find("bucket1")
que me muestra este error:
AWS::S3::PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/error.rb:38:in `raise'
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:72:in `request'
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:88:in `get'
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:102:in `find'
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:145:in `objects'
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:313:in `reload!'
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:242:in `objects'
from /home/surya/.rvm/gems/ruby-1.9.2-p180/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:253:in `each'
from (irb):5
from /home/surya/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
No entiendo la razón por la que esto está sucediendo porque ayer mismo estaba funcionando bien. ¿¿Alguna conjetura?? ¿¿Me estoy perdiendo de algo??
que se está conectando el nombre DNS S3 mal. No puede acceder a los depósitos de la región incorrecta. –
@spike Gronim Entonces, ¿cuál debería ser el DNS posible de usar? – Surya
bucket_name.s3.amazonaws.com –