Package detail

aws-param-env

vandium-io7.9kBSD-3-Clause2.1.0

Module for synchronously loading AWS SSM Parameter Store values into environment variables

AWS, SSM, secret, parameter store

readme

Build Status npm version

aws-param-env

Module for loading parameter-store values from AWS SSM into environment variables

Features

  • Loads parameters by path
  • Runs synchronously to that environment variables can be set before your code loads
  • Recursively loads and decodes parameters by default
  • Can run inside AWS Lambda environment
  • AWS Lambda Node.js 10.x compatible

Installation

Install via npm.

npm install aws-param-env --save

Note: aws-param-env does not contain a dependency on aws-sdk and it should be installed within your application.

Getting Started

const awsParamEnv = require( 'aws-param-env' );

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():

const awsParamEnv = require( 'aws-param-env' );

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 the AWS_REGION to the correct AWS region.

// AWS_SSM_ENV_PATH = '/my-services/service1/env', AWS_REGION='us-east-1'
require( 'aws-param-env' );

// environment variables are automatically loaded from the SSM parameter store

Feedback

We'd love to get feedback on how to make this tool better. Feel free to contact us at feedback@vandium.io

License

BSD-3-Clause

changelog

Change Log

2.1.0 (2019-12-04)

Updated:

  • aws-sdk peer dependency removed. Will use peer dependency set in aws-param-store

Internal:

  • Updated dependencies

2.0.0 (2019-11-04)

New:

  • Added support for automatically loading via environment variable: AWS_SSM_ENV_PATH

Updated:

  • Node 10.x and higher
  • Added aws-sdk as a peer dependency

Internal:

  • Updated dependencies
  • Refactored tests

1.2.0 (2018-01-08)

Improved:

  • Added options to define region

1.1.0 (2017-09-18)

New:

  • load() function that executes the query with a given path

1.0.0 (2017-09-13)

Initial Release