Can't find my S3 bucket

0

Newbie here :)

I created an S3 bucket and then wrote a basic PHP script that uploads a file into the bucket.

The script successfully connects to the bucket and uploads the file. But, when I log into my AWS console as a Root user, I am unable to see the bucket when I go to the S3 service and click on buckets. If I try to create a new bucket with the same name used for the original bucket, it won't let me... saying that the bucket already exists with that name.

Halllllp please :(

mw
asked a year ago813 views
6 Answers
1

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

profile picture
EXPERT
answered a year ago
0

Enter image description here

mw
answered a year ago
0

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";
}

mw
answered a year ago
0

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).

mw
answered a year ago
0

@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

mw
answered a year ago
0

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?

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions