title: Getting the error `Bucket name should not contain uppercase characters` when creating S3 buckets using serverless
body: <p>I wrote a <code>serverless.yml</code> where I create 3 <code>S3</code> bucket resources. This is some take home project I have to complete and it requires two buckets for static templates I have to process and one bucket for the results. I am defining SQS and it successfully created the queue and I was able to send messages to it from my lambda and receive messages by another lambda.</p>
  <p>However, defining S3 bucket resources gives me <code> An error occurred: S3LanguageTemplatesBucket - Bucket name should not contain uppercase characters.</code></p>
  <p>I tried to use hard-coded values for bucket names but it didn't help.</p>
  <p>The content of my <code>serverless.yml</code> file as follows:</p>
  <pre class="lang-yml prettyprint-override"><code>service: process-scores
  
  org: osano
  
  frameworkVersion: '2'
  
  provider:
    name: aws
    runtime: nodejs12.x
    profile: serverless-admin
    region: us-east-1
    environment:
      SQS_URL: MyQueue
      S3_HTML_TEMPLATES: ${self:service}-html-templates-sf68N5umh8gC8yM4
      S3_LANGUAGE_TEMPLATES: ${self:service}-language-templates-gY9b7REadVPtKChV
      S3_STATIC_WEBSITE: '${self:service}-static-website-pD4c7M2297pjAmST'
  
  functions:
    send:
      handler: scores/producer.send
      events:
        - http:
            path: scores
            method: post
            integration: lambda
            cors: true
      iamRoleStatements:
        - Effect: Allow
          Action:
            - &quot;sqs:SendMessage&quot;
            - &quot;sqs:GetQueueUrl&quot;
          Resource:
            Fn::GetAtt: [ MyQueue, Arn ]
  
    receive:
      handler: scores/consumer.receive
      events:
        - sqs:
            arn:
              Fn::GetAtt:
                - MyQueue
                - Arn
      iamRoleStatements:
        - Effect: Allow
          Action:
            - &quot;s3:GetObject&quot;
          Resource:
            - 'arn:aws:s3:::${self:provider.environment.S3_HTML_TEMPLATES}/*'
            - 'arn:aws:s3:::${self:provider.environment.S3_LANGUAGE_TEMPLATES}/*'
        - Effect: Allow
          Action:
            - &quot;s3:PutObject&quot;
          Resource:
            - 'arn:aws:s3:::${self:provider.environment.S3_STATIC_WEBSITE}/*'
  
  resources:
    Resources:
      MyQueue:
        Type: &quot;AWS::SQS::Queue&quot;
        Properties:
          QueueName: &quot;MyQueue&quot;
      S3HTMLTemplatesBucket:
        Type: &quot;AWS::S3::Bucket&quot;
        Properties:
          BucketName: '${self:provider.environment.S3_HTML_TEMPLATES}'
      S3LanguageTemplatesBucket:
        Type: &quot;AWS::S3::Bucket&quot;
        Properties:
          BucketName: '${self:provider.environment.S3_LANGUAGE_TEMPLATES}'
      S3StaticWebsiteBucket:
        Type: &quot;AWS::S3::Bucket&quot;
        Properties:
          BucketName: '${self:provider.environment.S3_STATIC_WEBSITE}'
  </code></pre>
  <p>I don't know if it can help but I also provided below the links to cloudformation templates that were generated:</p>
  <p><a href="https://gist.github.com/sashaProdan/783778bc776c71dff73cbbdb375222d7" rel="nofollow noreferrer">create-template</a></p>
  <p><a href="https://gist.github.com/sashaProdan/3af281d780fa48aa4d8122a22c772802" rel="nofollow noreferrer">update-template</a></p>