Serverless Parameter Subscriber
![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)
This is a serverless plugin that enables you to subscribe environment variables
in Lambdas to Systems Manager Parameter Store values. This enables you to share
configuration values that are used across multiple Lambdas in the Parameter
store and access them as environment variables. Need to update the parameter
value? Simply update the value once in the Parameter Store and within seconds,
all subscribing Lambdas will be using the updated value without the extra
overhead of calling out the the parameter store for every request.
Table of Contents
Install
Run npm install
in your Serverless project.
$ npm install --save-dev @agiledigital/serverless-parameter-subscriber
Add the plugin to your serverless.yml file
plugins:
- '@agiledigital/serverless-parameter-subscriber'
Setup
The following is an example serverless.yml
file demonstrating this plugin's
usage. You can try the example included in the repository.
service: params
provider:
name: aws
runtime: nodejs10.x
region: ap-southeast-2
stage: ${opt:stage, 'dev'}
functions:
one:
handler: handler.one
parameters:
ENV_VAR_ONE: ParamValue
two:
handler: handler.two
parameters:
ENV_VAR_TWO: ExternalParamValue
resources:
Resources:
ParamValue:
Type: AWS::SSM::Parameter
Properties:
Description: Dynamic parameter
Name: ParamValue
Type: String
Value: hello, dave
plugins:
- '@agiledigital/serverless-parameter-subscriber'