Skip to content

Python package to load configuration from YAML files with support for overriding from environment variables and AWS SSM

License

Notifications You must be signed in to change notification settings

dedalusj/ssm-config

Repository files navigation

ssm-config

Build Status codecov

Python package to load environment configuration from YAML files supporting overriding from environment variables and AWS SSM

Image you have an environment variable USERNAME=prod_user, an SSM parameter /prod/password=prod_password and the following YAML config file

default: &default
  username: a_user
  password: a_password
  host: a_host.com
prod:
  <<: *default
  username: <%= ENV['USERNANE'] %>
  password: <%= SSM['/prod/password'] %>

then the parsed config for prod will be

prod:
  username: prod_user
  password: prod_password
  host: a_host.com

The configuration can be loaded with

from ssm_config import load_env

dev_config = load_env('config.yml')  # load the config for the dev environment by default
staging_config = load_env('config.yml', env='staging')  # manually force to load the staging environment config

About

Python package to load configuration from YAML files with support for overriding from environment variables and AWS SSM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages