Skip to content
/ gorson Public
forked from pbs/gorson

experiment with go and aws ssm parameter store

License

Notifications You must be signed in to change notification settings

yhakbar/gorson

 
 

Repository files navigation

Stability

Warning: experimental

This is an experimental library, and is currently unsupported.

Usage

gorson loads parameters from AWS ssm parameter store, and adds them as shell environment variables.

Download parameters from parameter store as a json file

$ 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"

Load parameters as environment variables from a json file

source <(gorson load ./example.json)
$ env | grep 'alpha\|beta\|delta'
alpha=the_alpha_value
delta=the_delta_value
beta=the_beta_value

Upload parameters to parameter store from a json file

$ gorson put /a/parameter/store/path/ --file=./new-values.json

Installation

Currently gorson ships binaries for OS X and Linux 64bit systems. You can download the latest release from GitHub

OS X

$ wget https://github.com/pbs/gorson/releases/download/4.2.0/gorson-4.2.0-darwin-amd64

Linux

Download the binary

$ wget https://github.com/pbs/gorson/releases/download/4.2.0/gorson-4.2.0-linux-amd64

Move the binary to an installation path, make it executable, and add to path

mkdir -p /opt/gorson/bin
mv gorson-4.2.0-linux-amd64 /opt/gorson/bin/gorson
chmod +x /opt/gorson/bin/gorson
export PATH="$PATH:/opt/gorson/bin"

Notes

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=example-profile AWS_REGION=us-east-1 gorson get /a/parameter/store/path/

Development

See docs/development.md

About

experiment with go and aws ssm parameter store

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 71.8%
  • Shell 26.3%
  • Dockerfile 1.9%