serverless-api-stage
serverless-api-stage copied to clipboard
Add support for deploying to multiple stages
Currently if deploying first to the default stage (as specified in the provider
settings or by default) with sls deploy
and then deploying to a different stage, e.g. sls deploy --stage production
, an error occurs:
An error occurred while provisioning your stack: IamRoleApiGatewayCloudwatchLogRole
- project-name-ap-southeast-2-apiGatewayLogRole
already exists in stack arn:aws:cloudformation:ap-southeast-2:012345678910:stack/project-name-staging/41741b71-352e-11e7-b4ff-50fae94facba.
Complete output of second deployment, with -v
option:
Serverless: Packaging service...
Serverless: Commencing API Gateway stage configuration
Serverless: API Gateway stage configuration complete
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading service .zip file to S3 (25.52 MB)...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - project-name
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::SQS::Queue - PrerenderQueue
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - LastUpdatedLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - TargetBucket
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - GenerateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - PrerenderLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleApiGatewayCloudwatchLogRole
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::SQS::Queue - PrerenderQueue
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - LastUpdatedLogGroup
CloudFormation - CREATE_COMPLETE - AWS::SQS::Queue - PrerenderQueue
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - LastUpdatedLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - PrerenderLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - GenerateLogGroup
CloudFormation - CREATE_FAILED - AWS::IAM::Role - IamRoleApiGatewayCloudwatchLogRole
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - GenerateLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - PrerenderLogGroup
CloudFormation - CREATE_FAILED - AWS::S3::Bucket - TargetBucket
CloudFormation - UPDATE_ROLLBACK_IN_PROGRESS - AWS::CloudFormation::Stack - project-name-production
CloudFormation - UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - project-name-production
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - PrerenderLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::SQS::Queue - PrerenderQueue
CloudFormation - DELETE_COMPLETE - AWS::IAM::Role - IamRoleApiGatewayCloudwatchLogRole
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - GenerateLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - LastUpdatedLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::S3::Bucket - TargetBucket
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - PrerenderLogGroup
CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - GenerateLogGroup
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - LastUpdatedLogGroup
CloudFormation - DELETE_COMPLETE - AWS::S3::Bucket - TargetBucket
CloudFormation - DELETE_COMPLETE - AWS::SQS::Queue - PrerenderQueue
CloudFormation - UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - project-name-production
Serverless: Deployment failed!
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: IamRoleApiGatewayCloudwatchLogRole
- project-name-ap-southeast-2-apiGatewayLogRole
already exists in stack arn:aws:cloudformation:ap-southeast-2:012345678910:stack/project-name-staging/41741b71-352e-11e7-b4ff-50fae94facba.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Your Environment Information -----------------------------
OS: linux
Node Version: 7.7.2
Serverless Version: 1.8.0
I've been searching through serverless AWS plugins to find one that supports multiple stages. Currently working through an issue on this plugin: https://github.com/amplify-education/serverless-vpc-discovery/issues/4
I will update you if I find a plugin that has support added for it. Maybe we can get a pull request up for both plugins!
The biggest issue I'm running into is how to evaluate custom variables within the serverless.yml config that gets pulled in.