provide top level `bucket.region` property
See original GitHub issueCurrently, I am not aware of straight-forward method to learn about what region a bucket is located at.
import boto3
s3 = boto3.resource("s3")
bucket_name = "my_bucket_name"
bucket = s3.Bucket(bucket_name)
So far so good, now I am going to learn about region the bucket is living at:
bucket.region_name # not available
instead, I have to use following call (notice, how many times I have to say “bucket” or “location”):
region_name = s3.meta.client.get_bucket_location(Bucket=bucket.name)["LocationConstraint"]
It would be great to have bucket property “region_name” available.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Buckets overview - Amazon Simple Storage Service
When you create a bucket, you specify the AWS Region where you want Amazon S3 to create the bucket. Amazon S3 stores this...
Read more >amazon web services - Are S3 buckets region specific?
Amazon S3 creates bucket in a region you specify. You can choose any AWS region that is geographically close to you to optimize...
Read more >Why creating a single or limited global AWS S3 bucket in an ...
This will give more control to an organization over their data as it is kept centralized and secured. As a good practice, we...
Read more >Resources — Boto3 Docs 1.26.33 documentation - AWS
Overview¶. Resources represent an object-oriented interface to Amazon Web Services (AWS). They provide a higher-level abstraction than the raw, low-level ...
Read more >Integrating AWS S3 buckets with AWS RDS SQL Server
AWS provides a fully managed relational database service (RDS) in the ... a high-level overview of steps required to integrate an S3 bucket...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I know this issue is old but there is still no solutions for this. I found a way without extra-logic needed.
What do you think? Is it dangerous to rely on metadata?
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.