Description
First off, great plugin. It's been solving some very tough challenges for me and my team. Great work!
However, I've been trying to add the plugin to some already existing API deployments, and I'm getting an error when deploying the main stage alias. In this case, the API's ${provider.stage} is dev, which means the plugin tries to create a main alias deployment of "dev," which obviously already exists. Here's the --verbose output from the deployment after adding serverless-aws-alias to the plugins array on my serverless.yml:
$ sls deploy --verbose
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Preparing alias ...
Serverless: Processing custom resources
Serverless: Removing resources:
Serverless: Processing functions
Serverless: Processing API
Serverless: Configuring stage
Serverless: Processing SNS Lambda subscriptions
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (13.25 KB)...
Serverless: Uploading CloudFormation alias file to S3...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - ens-alias-dev
CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - GetLambdaFunction
CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - GetLambdaFunction
CloudFormation - UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - ens-alias-dev
CloudFormation - DELETE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - DELETE_COMPLETE - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - UPDATE_COMPLETE - AWS::CloudFormation::Stack - ens-alias-dev
Serverless: Stack update finished...
Serverless: Updating alias stack...
Serverless: Checking Stack update progress...
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - ens-alias-dev-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetLambdaVersionlQVnYRFBJjet0buDpEdpz3WEyYblwfMV4ZrjMIklfsI
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1508523706715
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1508523706715
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetLambdaVersionlQVnYRFBJjet0buDpEdpz3WEyYblwfMV4ZrjMIklfsI
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1508523706715
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - GetLambdaVersionlQVnYRFBJjet0buDpEdpz3WEyYblwfMV4ZrjMIklfsI
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Stage - ApiGatewayStage
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Alias - GetAlias
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Alias - GetAlias
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Alias - GetAlias
CloudFormation - CREATE_FAILED - AWS::ApiGateway::Stage - ApiGatewayStage
CloudFormation - UPDATE_ROLLBACK_IN_PROGRESS - AWS::CloudFormation::Stack - ens-alias-dev-dev
CloudFormation - UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - ens-alias-dev-dev
CloudFormation - DELETE_IN_PROGRESS - AWS::Lambda::Alias - GetAlias
CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::Stage - ApiGatewayStage
CloudFormation - DELETE_COMPLETE - AWS::Lambda::Alias - GetAlias
CloudFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1508523706715
CloudFormation - DELETE_IN_PROGRESS - AWS::Lambda::Version - GetLambdaVersionlQVnYRFBJjet0buDpEdpz3WEyYblwfMV4ZrjMIklfsI
CloudFormation - DELETE_COMPLETE - AWS::Lambda::Version - GetLambdaVersionlQVnYRFBJjet0buDpEdpz3WEyYblwfMV4ZrjMIklfsI
CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1508523706715
CloudFormation - UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - ens-alias-dev-dev
Serverless: Deployment failed!
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: ApiGatewayStage - dev already exists.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: win32
Node Version: 6.11.3
Serverless Version: 1.19.0
When I deploy an API with the plugin already installed, I do not have this problem. Am I missing a step here? Or should the plugin somehow be removing the existing "main stage" deployment before it recreates the new one in the new stack?
Again, super sweet plugin. Love it so far.