A Serverless Framework plugin for AWS API Gateway that enables stage variables and detailed logging configuration. Current stable version 1.4.0 adds custom Access Logging. The plugin creates an AWS::ApiGateway::Stage resource linked to the deployment, an IAM role for CloudWatch logs, and supports stage variables, method settings, cache, client certificate ID, and documentation version. It consolidates features from two separate plugins into one. Maintenance is sporadic; the roadmap includes breaking changes for v2 (optional role, standardised logical IDs, multiple stages). Key differentiator: tighter integration than manual CloudFormation.
npm install serverless-api-stageVerified import paths — ran on the pinned version, not inferred.
Minimal serverless.yml configuration to enable stage variables and detailed logging via the plugin.
Review migration guide when v2 is released; explicitly set role settings in custom.stageSettings.
Use resource logical IDs directly via CloudFormation refs; update any hardcoded references after upgrade.
Migrate to serverless-api-stage or use native Serverless Framework stage management.
Set custom.stageSettings.Role to your existing role ARN to override automatic creation. See docs.
Use Serverless Framework variable syntax: ${self:custom.stageSettings.Variables.foo} in function configuration.Ensure plugin is listed under 'plugins:' and installed via npm. Use 'serverless plugin list' to verify.
Remove duplicate Stage resource from serverless.yml resources section, or disable the plugin's stage creation by setting custom.stageSettings.createStage: false (if supported in v2).
Ensure the plugin creates the IAM role (do not override). Verify LoggingLevel is set in MethodSettings for the target HTTP method/resource.
Example:
custom:
stageSettings:
Variables:
myVar: myValue