Module for synchronously loading AWS SSM Parameter Store values into environment variables, fork of aws-param-env using awsdkv3
npm install aws-param-env-sdkv3
Module for loading parameter-store values from AWS SSM into environment variables
This fork has been updated to depend on aws-param-store-sdkv3, in order to support the AWS SDK v3 (and now depends only on the client-ssm module of the sdk).
npm install aws-param-env-sdkv3 --save
``js
const awsParamEnv = require( 'aws-param-env-sdkv3' );
awsParamEnv.load( '/my-service-path-in-ssm/env' );
`
If your AWS region is not set in your environment variables, then it can be set programmatically by supplying
options when calling load():
`js
const awsParamEnv = require( 'aws-param-env-sdkv3' );
awsParamEnv.load( '/my-service-path-in-ssm/env', { region: 'us-east-1' } );
`
To load the environment variables automatically from a path, set the AWS_SSM_ENV_PATH to the SSM path and theAWS_REGION to the correct AWS region.
`js
// AWS_SSM_ENV_PATH = '/my-services/service1/env', AWS_REGION='us-east-1'
require( 'aws-param-env-sdkv3' );
// environment variables are automatically loaded from the SSM parameter store
``