Skip to main content

Pass AWS SSM parameters as environment variables when executing a process

Project description

ssmenv2exec

Populate environment variables from AWS Systems Manager Parameter Store parameters before executing a process.

This allows application configuration to be stored in SSM rather than on the EC2 instance or Docker container.

Usage

pip install ssmenv2exec

Now you can use the ssmenv2exec script from the command line to execute your process and have the environment populated from an AWS SSM Parameter store path.

For example, in parameter store you can create parameters using a common path.

/app/myapp/DB_USER
/app/myapp/DB_PASS
/app/myapp/DB_URL
/app/myapp/SECRET_KEY

Then you can use ssmenv2exec to execute your program and the initial environment will contain values for DB_USER, DB_PASS, DB_URL and SECRET_KEY. If any of those already exist as environment variables they will not be overridden.

ssmenv2exec /app/myapp python app.py

ssmenv2exec will grab all parameters from the Parameter Store under the /app/myapp path and pass those as environment variables to the process. An exec call is used so that the process id (pid) remains consistent, which is useful for containerized environments.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssmenv2exec-0.0.1.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

ssmenv2exec-0.0.1-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page