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
feita há um ano859 visualizações
6 Respostas
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
ESPECIALISTA
respondido há um ano
0

Enter image description here

mw
respondido há um ano
  • 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:

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
respondido há um ano
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
respondido há um ano
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
respondido há um ano
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?

respondido há um ano

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas