Injects AWS Secrets Manager secrets as environment variables - or just prints them, if no command is given. (If you need secrets as files instead, you can use aws-secretsmanager-files)
Using go get:
go get -u github.com/keilerkonzept/${APP}
Or download the binary from the releases page.
# Linux
curl -L https://github.com/keilerkonzept/${APP}/releases/download/${VERSION}/${APP}_${VERSION}_linux_x86_64.tar.gz | tar xz
# OS X
curl -L https://github.com/keilerkonzept/${APP}/releases/download/${VERSION}/${APP}_${VERSION}_osx_x86_64.tar.gz | tar xz
# Windows
curl -LO https://github.com/keilerkonzept/${APP}/releases/download/${VERSION}/${APP}_${VERSION}_windows_x86_64.zip
unzip ${APP}_${VERSION}_windows_x86_64.zip
${APP} [OPTIONS] [COMMAND [ARGS...]]
${USAGE}
$ aws-secretsmanager-env -secret-string MY_SECRET=arn:aws:secretsmanager:eu-west-1:28381901202:secret:example-secret-1
MY_SECRET={"hello":"world"}
$ aws-secretsmanager-env -secret-json-key MY_SECRET=arn:aws:secretsmanager:eu-west-1:28381901202:secret:example-secret-1#hello
MY_SECRET="world"
$ aws-secretsmanager-env -secret-json-key-string MY_SECRET=arn:aws:secretsmanager:eu-west-1:28381901202:secret:example-secret-1#hello
MY_SECRET=world
$ aws-secretsmanager-env -secret-json-key-string MY_SECRET=arn:aws:secretsmanager:eu-west-1:28381901202:secret:example-secret-1#hello sh -c 'echo the secret is "$MY_SECRET"'
the secret is "world"