Skip to content

The CloudFormation template is invalid: Template format error: Resource name BasicAuthenticationApiGatewayAuthorizerproject-dev is non alphanumeric #140

Closed
@ziadloo

Description

@ziadloo

I have the following definition file:

service:                            SLS-Test

provider:
  name:                             aws
  stage:                            ${opt:stage, 'project-dev'}
  runtime:                          nodejs8.10
  role:                             arn:aws:iam::************:role/lambda_role

functions:
    basicAuthentication:
        name:                       test-basicAuthentication
        handler:                    basicAuthentication.handler
        environment:
            AUTH_PASS:              ${opt:x_password}
            AUTH_USER:              ${opt:x_user}

    f1:
        handler:                    hello_world.handler
        name:                       hello
        events:
            - http:
                integration:        lambda
                path:               helloWorld
                method:             get
                authorizer:         basicAuthentication

plugins:
  - serverless-aws-alias
  - serverless-prune-plugin

And I try to deploy it like this:

sls deploy --region us-east-1 --stage project-dev --alias project-dev --x_user me --x_password 123

And it results in the following error:

Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Preparing alias ...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (1.86 MB)...
Serverless: Validating template...
 
  Error --------------------------------------------------
 
  The CloudFormation template is invalid: Template format error: Resource name BasicAuthenticationApiGatewayAuthorizerproject-dev is non alphanumeric.
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           8.10.0
     Serverless Version:     1.32.0

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