- Newest
- Most votes
- Most comments
Hi mw,
Could be that you are trying to access s3 from a different region than the one where the bucket is.
Can you make sure you are in the region of choice?
Let me know
So when I visit the S3 bucket screen - it defaults to the "Global" region. I am not able to choose the N. California region that I created the bucket in.
When I use CloudShell to see if I can list out the buckets using (aws s3api get-bucket-acl --bucket YOUR_BUCKET_NAME), I am not able to switch my region to N. California before running that command.
When I run the following PHP script, it successfully lists the name of the bucket I created. So it does exist, I just can't for the life of me reach it :(
require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
$client = new S3Client([
'version' => 'latest',
'region' => $region,
'credentials' => [
'key' => $key,
'secret' => $secret,
],
]);
try {
$buckets = $client->listBuckets();
foreach ($buckets['Buckets'] as $bucket) {
echo $bucket['Name'] . "\n";
}
} catch (S3Exception $e) {
echo "Error listing buckets: {$e->getMessage()}\n";
}
Can you try to list buckets filtered for specific region with this approach and share output: https://repost.aws/questions/QUFFgl8uV9Q82DszsPNT5y1A/how-to-list-buckets-only-from-a-certain-region-using-the-cli
I am more than happy to bin it if I can't find it... but I just don't want to end up in a situation where I have a bucket with a 10kb file in it that ends up causing me financial pain (bills for stuff I can't see).
@alatech - So I used the command: aws s3api list-buckets --region "us-west-1"
Got this:
{
"Buckets": [],
"Owner": {
"DisplayName": "michael",
"ID": "LONG_STRING_OF_TEXT"
}
}
Then when I try this command: aws s3api get-bucket-location --bucket NAME_OF_BUCKET
I get this response: An error occurred (AccessDenied) when calling the GetBucketLocation operation: Access Denied
In addition to above, please go to the Cloudtrail console and check to see if there was a DeleteBucket call. Make sure you’re in the right account, such as IAM user. Please one more thing, did you click the refresh button?
Relevant content
- asked 9 months ago
- Accepted Answerasked 3 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 7 months ago
Thanks so much for your reply!
This is what I see. I am on "Global" view. Can't pick "us-west-1" which is where the bucket was set up.
That is expected because s3 must be created at a specific region, but its name must be unique globally, hence why you get the “bucket already exists” error.
Check the following: