Skip to content

Inject AWS SSM Parameters as Environment Variables

License

Notifications You must be signed in to change notification settings

meliuz/env-aws-params

 
 

Repository files navigation

env-aws-params

Build Status

env-aws-params is a tool that injects AWS EC2 Systems Manager (SSM) Parameter Store Key / Value pairs as Environment Variables when executing an application. It is intended to be used as a Docker Entrypoint, but can really be used to launch applications outside of Docker as well.

The primary goal is to provide a way of injecting environment variables for 12 Factor applications that have their configuration defined in the SSM Parameter store. It was directly inspired by envconsul.

Example Usage

Create parameters in Parameter Store:

aws ssm put-parameter --name /service-prefix/ENV_VAR1 --value example
aws ssm put-parameter --name /service-prefix/ENV_VAR2 --value test-value

Then use env-aws-params to have bash display the env vars it was called with:

env-aws-params --prefix /service-prefix /bin/bash -c set

If you want to include common and service specific values, --prefix can be specified multiple times:

env-aws-params --prefix /common /bin/bash -c set

CLI Options

Run env-aws-params --help for available options.

Building

This project uses dep. To build the project:

dep ensure
go build

About

Inject AWS SSM Parameters as Environment Variables

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 86.4%
  • Makefile 7.4%
  • Dockerfile 5.9%
  • Shell 0.3%