npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-api-stage

v1.4.0

Published

Serverless API Stage plugin, enables stage variables and logging for AWS API Gateway.

Downloads

3,109

Readme

Serverless API Stage plugin

serverless License: MIT npm version Build Status

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:

  • https://github.com/svdgraaf/serverless-plugin-stage-variables
  • https://github.com/paulSambolin/serverless-enable-api-logs

Namely:

  • In addition to the AWS::APIGateway::Deployment resource, an AWS::APIGateway::Stage resource is also created.
  • The stage is linked to the deployment, to replace the StageName property of the deployment.
  • The stage may have stage variables defined by custom.stageSettings.Variables in your serverless.yml.
  • The stage may have logging and other method properties defined by custom.stageSettings.MethodSettings in your serverless.yml.
  • An AWS::IAM::Role resource is created with the correct permissions to write Cloudwatch logs.
  • This IAM Role for logs is set in the AWS::ApiGateway::Account settings resource.

Installation

Install the plugin via npm.

Usage Example

#...
plugins:
  - serverless-api-stage
#...
custom:
  stageSettings:
    CacheClusterEnabled: true
    CacheClusterSize: '0.5'
    Variables:
      foo: bar
      baz: xyzzy
    MethodSettings:
      LoggingLevel: INFO
      CachingEnabled: true
      CacheTtlInSeconds: 3600
      # see below...
#...

The full list of MethodSettings available are defined in the AWS CloudFormation documentation.

Contributors

Please contribute by submitting a pull request, or raising an issue.

Code changes or additions should include corresponding unit test changes or additions. Tests can be run locally using npm test.

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 to npm.

Plugin Roadmap

Due to discussion with contributors, there are some breaking changes to be made to the plugin, namely:

  • Make the Role creation optional (and change the default behaviour)
  • Standardise the LogicalId of the ApiGatewayStage resource
  • Multiple stages

A migration guide will be provided.

See v2.