# Cannot redeploy - UploadBucket slsupload already exists

**URL:** <https://forum.serverless.com/t/cannot-redeploy-uploadbucket-slsupload-already-exists/1927>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [May 25, 2017, 4:21pm UTC](https://forum.serverless.com/t/cannot-redeploy-uploadbucket-slsupload-already-exists/1927 "2017-05-25T16:21:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![henning](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/henning/32/676_2.png) [@henning](https://forum.serverless.com/u/henning)\
**Post date:** [May 25, 2017, 4:21pm UTC](https://forum.serverless.com/t/cannot-redeploy-uploadbucket-slsupload-already-exists/1927/1 "2017-05-25T16:21:36Z")

</div>

Hi, this might be a Cloudformation problem, but as I use Cloudformation only through serverless, I start asking here:

On my way to try walking through a tutorial for a serverless service to write to S3 ([https://www.netlify.com/blog/2016/11/17/serverless-file-uploads/](https://www.netlify.com/blog/2016/11/17/serverless-file-uploads/) ) I bump into the situation that I cannot deploy my service again.

When running deploy, I get an error message:

“An error occurred while provisioning your stack: UploadBucket  
- slsupload already exists.”

I also executed the remove command, which seemed to run successful, at least no error message.  
In the cloudformation stack view in the aws web interface it clearly said that it also remove the S3 resource successfully.

I the S3 webinterface on AWS there is no Bucket with either the name slsupload nor UploadBucket (I am not sure under which name it is supposed to appear).

My questions are:

- were do I actually see this bucket in S3
- why is it not deleted with sls remove?
- are these cloudformation resources not idempotent?

my serverless.yml is:

service: s3-writer-test

provider:  
name: aws  
runtime: nodejs6.10  
region: eu-central-1  
iamRoleStatements:  
- Effect: "Allow"  
Action:  
- “s3:_"  
Resource: "arn:aws:s3:::slsupload/_”

functions:  
writeme:  
handler: handler.writeme  
events:  
- http:  
path: writeme  
method: get

resources:  
Resources:  
UploadBucket:  
Type: AWS::S3::Bucket  
Properties:  
BucketName: slsupload  
AccessControl: PublicRead  
CorsConfiguration:  
CorsRules:  
- AllowedMethods:  
- GET  
- PUT  
- POST  
- HEAD  
AllowedOrigins:  
- “_"  
AllowedHeaders:  
- "_”

---

<div class="post-metadata">

**Author:** ![bfieber](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bfieber/32/653_2.png) [@bfieber](https://forum.serverless.com/u/bfieber)\
**Post date:** [May 25, 2017, 5:20pm UTC](https://forum.serverless.com/t/cannot-redeploy-uploadbucket-slsupload-already-exists/1927/2 "2017-05-25T17:20:49Z")

</div>

Keep in mind that S3 Bucket names need to be globally unique.  
So anybody else who’s done that tutorial has run into the same problem.  
Netlify should update their tutorial to explain that you need to alter the bucket name to make it unique.  
eg. instead of ‘slsupload’ pick something like 'henning-dev-slsupload’  
and use that value throughout the tutorial.

Hope this helps.

For more info see the #3 on this amazon [S3 Getting Started page](http://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html):  
and [Rules for Bucket Naming](http://docs.aws.amazon.com/AmazonS3/latest/dev//BucketRestrictions.html#bucketnamingrules) in the Developers Guide.

---

<div class="post-metadata">

**Author:** ![henning](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/henning/32/676_2.png) [@henning](https://forum.serverless.com/u/henning)\
**Post date:** [May 25, 2017, 5:35pm UTC](https://forum.serverless.com/t/cannot-redeploy-uploadbucket-slsupload-already-exists/1927/3 "2017-05-25T17:35:13Z")

</div>

yes, that seems to work!

If I rename the bucket I can also deploy and deploy my application again!

Maybe I oversaw that this error appeared already the first time I deployed it.

Thanks!

---

<div class="post-metadata">

**Author:** ![bfieber](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bfieber/32/653_2.png) [@bfieber](https://forum.serverless.com/u/bfieber)\
**Post date:** [May 25, 2017, 6:46pm UTC](https://forum.serverless.com/t/cannot-redeploy-uploadbucket-slsupload-already-exists/1927/4 "2017-05-25T18:46:16Z")

</div>

Glad I could help.  
And yes. as long as you keep the bucket, nobody else can take your bucket name.  
Therefore, you can re-deploy as much as you wish forever.
