config-lambda
Simple file based configuration for multi stage lambda deployments with support for other configuration factories like credstash-lambda.
installation
$ npm install --save config-lambda
options
- environments: (OBJECT) the environments object
- stage: (STRING) the stage of deployment, referring to which section of the environments object should be used for configuration
usage
Config.get(key)
environments.json
const Config = environments: stage: 'dev'; { ... ;} moduleexports { let sampleValue = Config; console; ;}
Config.load([factory]) / Config.get(key)
environments.json
const Config = environments: stage: 'dev';const Credstash = table: 'SECRET_TABLE' region: 'AWS_REGION' keys: 'SAMPLE_SECRET_KEY'; { ... ;} moduleexports { Config}