Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What did you implement:
Closes #1918 #2665 #1704
Make API Gateway stage configuration available, including but not limited to logging, throttling and stage variables.
How did you implement it:
By adding an actual
AWS::ApiGateway::Stage
resource instead of simply using theStageName
property ofAWS::Apigateway::Deployment
.I have also moved the service endpoint output from the deployment to the stage, since that is where it logically belongs.
The reason this is a breaking change is that using
StageName
fromAWS::ApiGateway::Deployment
implicitly creates a stage which conflicts withAWS::ApiGateway::Stage
when using the same name, so I had to remove it. This makes updating existing deployments that were created using previous versions of serverless impossible (a workaround would be to create an intermediary stage, manually delete the stage implicitly created by the previous deployment, and then recreate the original stage).How can we verify it:
To verify that everything works as before, simply deploy a Lambda function with an
http
event as usual.To verify that it is now possible to configure the stage, add a
ApiGatewayStage
resource with some configuration (see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html for available options).For example, to enable logging and add a stage variable:
Todos:
Is this ready for review?: YES
Is it a breaking change?: YES