I am trying to delete uploaded image files with the AWS-SDK-Core Ruby Gem.
I have the following code:
require \'aws-sdk-core\'
def pull_picture(pict
For ppl who are still facing this issue, try adding s3_host as follows to the config hash
:storage => :s3,
:s3_credentials => {:access_key_id => access key,
:secret_access_key => secret access key},
:bucket => bucket name here,
:s3_host_name => s3-us-west-1.amazonaws.com or whatever comes as per your region}.
This fixed the issue for me.
After a long search, I found a working solution. The issue was because of the wrong region-code
.
below is the list of region-codes, set the appropriate one and your issue will be solved.
Code Name
US East (Ohio) us-east-2
US East (N. Virginia) us-east-1
US West (N. California) us-west-1
US West (Oregon) us-west-2
Asia Pacific (Hong Kong) ap-east-1
Asia Pacific (Mumbai) ap-south-1
Asia Pacific (Osaka-Local) ap-northeast-3
Asia Pacific (Seoul) ap-northeast-2
Asia Pacific (Singapore) ap-southeast-1
Asia Pacific (Sydney) ap-southeast-2
Asia Pacific (Tokyo) ap-northeast-1
Canada (Central) ca-central-1
Europe (Frankfurt) eu-central-1
Europe (Ireland) eu-west-1
Europe (London) eu-west-2
Europe (Paris) eu-west-3
Europe (Stockholm) eu-north-1
Middle East (Bahrain) me-south-1
South America (São Paulo) sa-east-1
You can find your region-code on click of bucket name right corner.
For mode details Click
It seems likely that this bucket was created in a different region, IE not us-west-2. That's the only time I've seen "The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint."
US Standard is
us-east-1