This is an experimental library, and is currently unsupported.
gorson
loads parameters from AWS ssm parameter store, and adds them as shell environment variables.
gorson get /a/parameter/store/path/ > ./example.json
$ cat ./example.json
{
"alpha": "the_alpha_value",
"beta": "the_beta_value",
"delta": "the_delta_value"
}
There's also a --format
flag to pass in which format you want the parameters to export as.
gorson get --format yaml /a/parameter/store/path/ > ./example.yml
$ cat ./example.yml
alpha: "the_alpha_value"
beta: "the_beta_value"
delta: "the_delta_value"
gorson get --format env /a/parameter/store/path/ > ./.env
$ cat ./.env
alpha="the_alpha_value"
beta="the_beta_value"
delta="the_delta_value"
source <(gorson load ./example.json)
$ env | grep 'alpha\|beta\|delta'
alpha=the_alpha_value
delta=the_delta_value
beta=the_beta_value
gorson put /a/parameter/store/path/ --file=./new-values.json
$ gorson put /a/parameter/store/path/ --file=./different-values.json --delete
The following are not present in the file, but are in parameter store:
/a/parameter/store/path/gamma
Are you sure you'd like to delete these parameters?
Type yes to proceed:
If you would like to answer 'yes' to any prompts that require it, append --auto-approve
.
If you would prefer the output of commands to be colorless, append --no-color
.
Currently gorson ships binaries for MacOS and Linux 64bit systems. You can download the latest release from GitHub
wget https://github.com/pbs/gorson/releases/latest/download/gorson-darwin-amd64
Download the binary
wget https://github.com/pbs/gorson/releases/latest/download/gorson-linux-amd64
For either MacOS or Linux, replace the amd64
with arm64
above.
Move the binary to an installation path, make it executable, and add to path
mkdir -p /opt/gorson/bin
mv gorson-linux-amd64 /opt/gorson/bin/gorson
chmod +x /opt/gorson/bin/gorson
export PATH="$PATH:/opt/gorson/bin"
Install using asdf
Add asdf plugin
asdf plugin add gorson https://github.com/pbs/asdf-pbs.git
List available versions
asdf list-all gorson
Install a particular version
asdf install gorson 13
Make a particular version your default
asdf global gorson 13
These environment variables will affect the AWS session behavior:
https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html
AWS_PROFILE
: use a named profile from your ~/.aws/config
file (see https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)AWS_REGION
: use a specific AWS region (see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html)AWS_PROFILE=example-profile AWS_REGION=us-east-1 gorson get /a/parameter/store/path/