2 Answers
- Newest
- Most votes
- Most comments
0
You could use the get bucket location API https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html
0
Hi,
For buckets with public access that you don't own, curl -sI https://<bucket-dns> | grep bucket-region
should work. It returns x-amz-bucket-region: <region-name>
.
AFAIK, for private buckets that you don't know: no way to know the region. And obviously, it is by design.
Best,
Didier
This is a really neat way of getting the required info. It may be better to use http:// rather than https:// though, as in cases where the bucket is being used for static website hosting the https:// address will return an SSL error.
Relevant content
- asked a year ago
- Accepted Answerasked 4 years ago
- asked 4 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 6 months ago
Doesn't this require owning the bucket, or at least knowing which account does?