- Newest
- Most votes
- Most comments
To my knowledge to access an s3 bucket you need to connect to the s3 endpoint in the region the bucket is located in, hence why the region parameter is required for the client (so it can get the endpoint)....See more info here.
There is a feature to use multi-region access points and in that scenario you need to provide the s3 client the access point instead of the bucket directly
What platform are you running the s3 client on? If on Lambda you can reveal the region the lambda is running in from the environment variable AWS_REGION, there is similar in ECS and in EC2 can be gathered via metadata service. Where the platform and bucket are or might be in different regions I suggest using an SSM parameter to store the region for the bucket and your application can get the parameter to get the correct region
Relevant content
- asked 6 months ago
- Accepted Answerasked 2 years ago
- asked 8 months ago
- AWS OFFICIALUpdated 2 years ago
- How can I configure my Amazon VPC to privately connect to my S3 bucket without using authentication?AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
I am using java SDK for accessing the s3 buckets and other resources status