Storing configuration in the environment, as in a Twelve factor App, is a common use case. However there are cases where there's the need to properly secure the value of those variables, for example when exposing secrets (such as usernames and passwords) or defining API Tokens.
aws-ssm-env
is a Go package that allows you load configuration values from environment variables and in cases where explicitly stated it could load the values from AWS SSM.
- Define a new struct that will hold all your configuration values, decorate it using the
ssm
tag. - Load your configuration file, if needed.
- Initialize AWS SSM
- Load the configuration values.
Please look at the example for a concrete full example.
- Install
direnv
- Install required tools using
./script/tools.sh
go generate ./...
andgo test ./...
as usual