serverless-add-api-key
A serverless plugin to create api key and usage pattern (if they don't already exist) and associate them to the Rest Api. Serverless provides this functionality natively but it doesn't allow you to associate multiple services with same apiKey and usage plan. This plugin associates your Serverless service with same api key if the key already exists. Also works with multiple keys.
Install
npm install --save-dev serverless-add-api-key
Add the plugin to your serverless.yml
file:
plugins:
- serverless-add-api-key
Configuration
custom:
apiKeys: [<api key name>]
Code automatically creates a usage plan called <api-key-name>-usage-plan
.