in reply to Re^2: How to specify a Region when creating an AWS S3 bucket?
in thread How to specify a Region when creating an AWS S3 bucket?

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.