首页 > 解决方案 > 如何确定公共 AWS S3 存储桶的区域?

问题描述

我知道我可以通过以下方式确定我拥有的 AWS S3 存储桶的区域:

aws s3api get-bucket-location --bucket <my-bucket>

但是如何确定公共访问存储桶的区域(显然我不拥有)?

如果我尝试访问诸如 noaa-goes16 之类的 AWS 开放数据存储桶之一:

$ aws s3api get-bucket-location --bucket noaa-goes16

我得到:

An error occurred (AccessDenied) when calling the GetBucketLocation operation: Access Denied

标签: amazon-web-servicesamazon-s3

解决方案


是的,你会认为这会更容易弄清楚,但这是我使用的方法:

$ curl -sI https://noaa-goes16.s3.amazonaws.com | grep bucket-region

返回:

x-amz-bucket-region: us-east-1

推荐阅读