Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to specify a Region when creating an AWS S3 bucket?

by marto (Cardinal)
on Oct 25, 2013 at 14:09 UTC ( [id://1059675]=note: print w/replies, xml ) Need Help??


in reply to How to specify a Region when creating an AWS S3 bucket?

Are you reading the documentation?:

"Note: This is the legacy interface, please check out Net::Amazon::S3::Client instead."

Looking at Net::Amazon::S3::Client it shows examples of doing exactly what you want.

  • Comment on Re: How to specify a Region when creating an AWS S3 bucket?

Replies are listed 'Best First'.
Re^2: How to specify a Region when creating an AWS S3 bucket?
by Anonymous Monk on Jan 09, 2017 at 13:06 UTC
    Hi, yes ... but the location_constraint parameter only accepts the values 'US' or 'EU' ... correct? Therefore you'll end up either at the Irland location (EU) or at the US East - N. Virginia location (US). I can't specify other valid AWS locations like eu-central-1 (Frankfurt). See complete list of location constraints: http://docs.aws.amazon.com/general/latest/gr/rande.html Even if I create a bucket in the AWS console - and than using this bucket in my Perl script - I can't create objects in that bucket.
      Isn't it because of the Signature V4? This GitHub PR might fix it.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      Before using location_constraint you must pass the host parameter to the Net::Amazon::S3 constructor. (Note I have never found it necessary to use the param after connecting in this way).

      Here's how I do it:

      $conf = { aws_access_key_id => 'foo', aws_secret_access_key => 'bar', host => 's3-us-west-1.amazonaws.com', }; my $s3_base = Net::Amazon::S3->new( $conf ); my $s3 = Net::Amazon::S3::Client->new( s3 => $s3_base ); my $bucket = $s3->bucket( name => $bucket_name ); ...

      Hope this helps!


      The way forward always starts with a minimal test.
Re^2: How to specify a Region when creating an AWS S3 bucket?
by OfficeLinebacker (Chaplain) on Oct 25, 2013 at 14:13 UTC
    Dammit. The direction of the answer from the last thread was to use this module.

      Well I don't know what to tell you, other than to suggest that when someone tells you to use Module::X/product X/Service X, take the time to read the documentation and if possible open bugs. It'll save you a lot of time. FWIW this interface looks to be easier to use than the legacy one.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1059675]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-16 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found