AWS Secrets Environment
A Node module to easily load AWS Secrets Manager JSON secrets into your application's environment variables.
- Each key from the loaded secret will be registered as
process.env[key]
- Existing process.env.xxx variables will not be overwritten.
- If the value of said key is 'true' or 'false', it will be converted to a boolean
Usage
With these secrets stored in AWS Secrets Manager as MyApplicationDevSecrets
:
const loadAWSJSONSecretsIntoENV = const region = 'us-east-1'const secretName = 'MyApplicationDevSecrets' // set an env var before loading? it won't get overriddenprocessenvDB_PASS = 'secret-from-code' await console// Output is: "development", "user-from-aws", 'secret-from-code' // start your application