AWS S3: The bucket you are attempting to access must be addressed using the specified endpoint

后端 未结 15 420
南旧
南旧 2020-12-02 10:33

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         


        
相关标签:
15条回答
  • 2020-12-02 11:31

    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.

    0 讨论(0)
  • 2020-12-02 11:31

    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

    0 讨论(0)
  • 2020-12-02 11:34

    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

    0 讨论(0)
提交回复
热议问题