AWS S3 bucket is being accessed from any region even though it is created in us-west-2
I am using Java SDK for aws to create S3 client to access s3 bucket connection status. Now, the current bucket which I am accessing is originally in region us-west-2. But during creating an s3 client(to access the bucket programatically) if I pass any other region other then us-west-2 also, the client is being created and I am getting the connection status as true. I am confused, shouldn't it return as failed if I am passing some other region than the region it is currently located in?
Buckets are global so you don't actually need to specify a region in your requests. Still, it's a good idea to provide the right region as it avoids a request going to us-east-1 to find out where your bucket is. Not only it is more efficient but it removes an unnecessary dependency on S3 in us-east-1 so one less thing to go wrong and cause an outage. I haven't tried passing a "wrong" region as you describe but given that specifying region is optional it makes sense to me that AWS would honour the request anyway rather than getting picky. Probably it just means you've added yet more overhead - the request goes to the wrong region, then us-east-1, then the right region.
AWS::Synthetics::Canary Not Creating S3 Bucket in EUAccepted Answerasked 6 months ago
Access denied when deleting S3 bucketAccepted Answerasked 25 days ago
Access denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfront
Is it possible to use artifacts in an S3 Bucket From a Different Region To CodeDeploy Applicationasked 4 months ago
S3 Bucket cannot be reached in GroundTruth Labelingasked 3 months ago
Access denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfrontAccepted Answer
AWS S3 bucket is being accessed from any region even though it is created in us-west-2Accepted Answerasked 18 days ago
Create aws_secret_access_key for S3 bucketasked 9 months ago
Access bucket s3 from a role on another accountasked 9 months ago
Can AWS CloudFormation template access s3 from any region other than its current region?asked 15 days ago