Skip to content

Check if S3 bucket name is already taken when generating bucket name #2222

Open
@larissa-n

Description

@larissa-n

Is your feature request related to a problem? Please describe.

Deployment of new install (following tutorial) kept failing at bucket creation with error 403.

Screen Shot 2022-02-04 at 1 27 28 PM

Trying to create bucket of the same name in AWS directly, the response is: cannot create bucket with same name as one that already exists.

AWS policy is that S3 buckets must have unique names across all of AWS, so if you pick a bad name and don't check, bucket creation will fail. It seems that that's what happened with the webiny script.

Describe the solution you'd like.

Automatically generate bucket name that does not already exist on AWS.

AWS recommends checking if a bucket name already exists before generating a new one, and has a command for it: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/head-bucket.html

Describe alternatives you've considered.

It might be worthwhile to mention the issue in the docs, and as a temporary workaround recommend to delete the project and start from scratch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions