This plugin will seed your AWS SSM Parameter Store with the environment you have defined in your serverless config. By default your .env will be used to populate the values;
More information about SSM environment variables: Server Variables from AWS SSM Parameter Store
npm i serverless-ssm-seed --save-dev
In your serverless.yml
:
plugins:
- serverless-ssm-seed
custom:
ssm:
secure: ['SECURE_VAR']
ignore: ['SOME_VAR']
stages: ['dev', 'staging', 'production']
environment:
SECURE_VAR: ${ssm:/${self:custom.stage}/SECURE_VAR~true}
SOME_VAR: ${ssm:/${self:custom.stage}/SOME_VAR}
Seed using your .env values for the defaults:
sls ssm-seed
Use a string instead of .env values for the defaults:
sls ssm-seed --ssm-default='default'
- Login to your AWS Console
- Services -> Systems Manager
- Parameter Store
You should now see your environment parameters.