# Can't create an s3 bucket

**URL:** <https://forum.serverless.com/t/cant-create-an-s3-bucket/14002>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [February 9, 2021, 6:56pm UTC](https://forum.serverless.com/t/cant-create-an-s3-bucket/14002 "2021-02-09T18:56:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jswheeler](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jswheeler/32/5226_2.png) [@jswheeler](https://forum.serverless.com/u/jswheeler)\
**Post date:** [February 9, 2021, 6:56pm UTC](https://forum.serverless.com/t/cant-create-an-s3-bucket/14002/1 "2021-02-09T18:56:57Z")

</div>

I’m trying to create an s3 bucket. I’ve build a few serverless templates in the past, but this is the first time I’ve tried to create a bucket. Simple yaml below

```
service: aws-ses-forwarder
frameworkVersion: '2'

provider:
  name: aws
  runtime: nodejs12.x
  lambdaHashingVersion: 20201221

custom:
  BucketName:
    Name: ses-forwarder    

functions:
  hello:
    handler: handler.hello

resources:
  Resources:
    MYSESForwardBucket:
      Type: 'AWS::S3::Bucket'
      Properties:
        BucketName: 'mycoolbucket'

```

Sort of followed this [examples/serverless.yml at master · serverless/examples · GitHub](https://github.com/serverless/examples/blob/master/aws-node-ses-receive-email-body/serverless.yml)

Here is the error.  
% serverless --profile tcdev --stage dev deploy -v  
Serverless: Packaging service…  
Serverless: Excluding development dependencies…  
Serverless: Uploading CloudFormation file to S3…  
Serverless: Uploading artifacts…  
Serverless: Uploading service aws-ses-forwarder.zip file to S3 (392 B)…  
Serverless: Validating template…  
Serverless: Updating Stack…  
Serverless: Checking Stack update progress…  
CloudFormation - UPDATE\_IN\_PROGRESS - AWS::CloudFormation::Stack - aws-ses-forwarder-dev  
CloudFormation - CREATE\_IN\_PROGRESS - AWS::S3::Bucket - MYSESForwardBucket  
CloudFormation - CREATE\_IN\_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution  
CloudFormation - CREATE\_IN\_PROGRESS - AWS::Logs::LogGroup - HelloLogGroup  
CloudFormation - CREATE\_FAILED - AWS::S3::Bucket - MYSESForwardBucket  
CloudFormation - CREATE\_IN\_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution  
CloudFormation - CREATE\_FAILED - AWS::IAM::Role - IamRoleLambdaExecution  
CloudFormation - CREATE\_FAILED - AWS::Logs::LogGroup - HelloLogGroup  
CloudFormation - UPDATE\_ROLLBACK\_IN\_PROGRESS - AWS::CloudFormation::Stack - aws-ses-forwarder-dev  
CloudFormation - UPDATE\_ROLLBACK\_COMPLETE\_CLEANUP\_IN\_PROGRESS - AWS::CloudFormation::Stack - aws-ses-forwarder-dev  
CloudFormation - DELETE\_IN\_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution  
CloudFormation - DELETE\_COMPLETE - AWS::S3::Bucket - MYSESForwardBucket  
CloudFormation - DELETE\_COMPLETE - AWS::Logs::LogGroup - HelloLogGroup  
CloudFormation - DELETE\_COMPLETE - AWS::IAM::Role - IamRoleLambdaExecution  
CloudFormation - UPDATE\_ROLLBACK\_COMPLETE - AWS::CloudFormation::Stack - aws-ses-forwarder-dev  
Serverless: Operation failed!  
Serverless:

Serverless Error ---------------------------------------

An error occurred: MYSESForwardBucket - mycoolbucket already exists.

Your Environment Information ---------------------------  
Operating System: darwin  
Node Version: 14.4.0  
Framework Version: 2.18.0 (standalone)  
Plugin Version: 4.4.2  
SDK Version: 2.3.2  
Components Version: 3.4.5

No bucket with that name exists. I’ve changed the bucket name. I’ve removed the quotes. Any suggestions?

Blockquote

---

<div class="post-metadata">

**Author:** ![jswheeler](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jswheeler/32/5226_2.png) [@jswheeler](https://forum.serverless.com/u/jswheeler)\
**Post date:** [February 9, 2021, 8:02pm UTC](https://forum.serverless.com/t/cant-create-an-s3-bucket/14002/2 "2021-02-09T20:02:31Z")

</div>

Not sure why, but the custom section seems to override whatever name I provide in the resource section. This works

```
service: aws-ses-forwarder
frameworkVersion: '2'

provider:
  name: aws
  runtime: nodejs12.x
  lambdaHashingVersion: 20201221
  stage: dev

functions:
  hello:
    handler: handler.hello

resources:
  Resources:
    S3Assets:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: ${self:service}-${self:provider.stage}-assets
```

---

<div class="post-metadata">

**Author:** ![pgrzesik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/pgrzesik/32/5054_2.png) [@pgrzesik](https://forum.serverless.com/u/pgrzesik)\
**Post date:** [February 10, 2021, 11:01am UTC](https://forum.serverless.com/t/cant-create-an-s3-bucket/14002/3 "2021-02-10T11:01:01Z")

</div>

Hello, in your first example, are you sure that no such bucket with `mycoolbucket` name exists? Seems like a pretty plausible name and Bucket names have to unique globally.

---

<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:** [February 11, 2021, 3:13pm UTC](https://forum.serverless.com/t/cant-create-an-s3-bucket/14002/4 "2021-02-11T15:13:47Z")

</div>

Keep in mind that bucket names must be globally unique. So even if YOU don’t already have a bucket with that name, somebody else probably does.

Update your template to make the name unique in some way, like `{yourname}-mycoolbucket` and you may have better luck.

---

<div class="post-metadata">

**Author:** ![jswheeler](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jswheeler/32/5226_2.png) [@jswheeler](https://forum.serverless.com/u/jswheeler)\
**Post date:** [February 11, 2021, 10:19pm UTC](https://forum.serverless.com/t/cant-create-an-s3-bucket/14002/5 "2021-02-11T22:19:56Z")

</div>

That could very well be. Thanks for pointing that out.
