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 questions
Access denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfront
asked 8 months agoAWS SDK PHP on S3 can't make a request using the web-browser
asked a year agoDoes the AmazonS3 class from the AWS JavaSDK use the public internet to upload a file to an s3 bucket?
Accepted Answerasked 7 months agoAccess denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfront
Accepted Answerasked 8 months agoUnable to connect to S3 from EC2 - PHP SDK
asked a year agoUsing JavaScript and AWS SDK to access S3 Bucket without Credentials
asked 2 years agoS3 Bucket cannot be reached in GroundTruth Labeling
asked 4 months agoCan s3Client be made without using s3 bucket region?
Accepted Answerasked a month agoChanging S3 Bucket Region of Aws Amplify
asked a month agoHow to use the Multi Region Access Point in AWS S3 using the hostname?
Accepted Answerasked 7 months ago
I am using java SDK for accessing the s3 buckets and other resources status