SSM Parameter Validation is a package that validate if all the variables listed in docker-compose are configured in SSM (System Manager in AWS) as environment variables.
This works for projects that locally are docker based (and uses docker compose) and in production uses SSM as environment parameters control.
Install the package in your dev-dependencies:
npm install @zrpaplicacoes/ssm-parameter-validation --save-dev
And then import the file in your code to use:
const { ssmValidation } = require('./index.js');
ssmValidation(config);
You can both configure your project variables through config file or environment variables.
Simply run:
npx @zrpaplicacoes/ssm-parameter-validation execute
Docker only supports configuration through environment variables, so run:
docker run -v /${PWD}/docker-compose.yml:/home/node/app/docker-compose.yml -e AWS_REGION='<<region>>' -e AWS_SECRET_ACCESS_KEY='<<config>>' -e AWS_ACCESS_KEY_ID='<<config>>' -e PARAMETERS_PATH='<<config>>' -e IGNORE_PARAMETERS='<<config>>' zrpaplicacoes/ssm-parameter-validation
This package accepts a config file as configuration which is a JS objects with:
{
aws: {
region: your aws region,
awsSecretAccessKey: your secret key (DO NOT COMMIT THAT),
awsAccessKeyId: your access key,
},
ignoreParameters: parameters that you want to ignore, a string with comma separeted parameters,
parametersPath: where should this package search for parameters in ssm,
}
Your must just define the following environment variables:
AWS_REGION='your aws region' AWS_SECRET_ACCESS_KEY='your secret key (DO NOT COMMIT THAT)' AWS_ACCESS_KEY_ID='your access key' IGNORE_PARAMETERS='parameters that you want to ignore, a string with comma separeted parameters' PARAMETERS_PATH='where should this package search for parameters in ssm'
Carlos Sechi 💻📖 👀 🚧 |
Rafael Costella 💻 📖 👀 🚧 |
This project follows the all-contributors specification.