Serverless API Stage plugin
Plugin for the serverless framework that allows the use of stages with defined stage variables and logging configuration, when using the AWS provider.
This is a rewritten plugin with the same functionality provided by two existing plugins:
- In addition to the
AWS::APIGateway::Stageresource is also created.
- The stage is linked to the deployment, to replace the
StageNameproperty of the deployment.
- The stage may have stage variables defined by
- The stage may have logging and other method properties defined by
AWS::IAM::Roleresource is created with the correct permissions to write Cloudwatch logs.
- This IAM Role for logs is set in the
#...plugins:- serverless-api-stage#...custom:stageSettings:CacheClusterEnabled: trueCacheClusterSize: '0.5'Variables:foo: barbaz: xyzzyMethodSettings:LoggingLevel: INFOCachingEnabled: trueCacheTtlInSeconds: 3600# see below...#...
The full list of
MethodSettings available are defined in the
AWS CloudFormation documentation.
Code changes or additions should include corresponding unit test changes or additions. Tests can be run locally using
Please don't update the
version attribute in
package.json, as multiple changes might be bundled into a single
release. Version bumps will be done in separate pull requests at the time of creating the release and publishing
Due to discussion with contributors, there are some breaking changes to be made to the plugin, namely:
- Make the
Rolecreation optional (and change the default behaviour)
- Standardise the
- Multiple stages
A migration guide will be provided.