How to solve ' StagingBucket already exists' when I try to Bootstrap?

Viewed 653

I'm trying to deploy my python aws cdk stack.

Reminder, the steps are:

cdk init app --language python
pip3 install -r requirements.txt
cdk synthesize
cdk bootstrap
cdk deploy

When I reach the cdk bootstrap I get the following error:

CDKToolkit: creating CloudFormation changeset...
12:17:23 PM | CREATE_FAILED        | AWS::S3::Bucket       | StagingBucket
cdk-hnb659fds-assets-#########-us-east-1 already exists

There actually is a bucket with that name, but it's not mine (it belongs to my co-worker) and it contains files (I can't delete it)

How can I solve this? I really appreciate any help you can provide.

2 Answers

I deleted the overlapping resources and it worked.

I tried using this flag and it seems about right.

(Override the bucket name)

cdk bootstrap --bootstrap-bucket-name majdvpc-stg

Related