serverless-heaven / serverless-aws-alias

Alias support for Serverless 1.x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ziadloo opened this issue · comments

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

I created a pull request for this: #149

I appreciate it if someone could take a look into this.

@HyperBrain, I appreciate it if you could take a look at this pull request. I need this published for my project. Thanks.

colsed by #149