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

后端 未结 15 462
南旧
南旧 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:15

    During the creation of S3Client you can specify the endpoint mapping to a particular region. If default of s3.amazonaws.com then bucket will be created in us-east-1 which is North Virginia.

    More details on S3 endpoints and regions in AWS docs: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region.

    So, always make sure about the endpoint/region while creating the S3Client and access S3 resouces using the same client in the same region.

    If the bucket is created from AWS S3 Console, then check the region from the console for that bucket then create a S3 Client in that region using the endpoint details mentioned in the above link.

提交回复
热议问题