Skip to content

Instantly share code, notes, and snippets.

@nascimento
Created October 29, 2018 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nascimento/38900cd4142489070600a583efa6ace2 to your computer and use it in GitHub Desktop.
Save nascimento/38900cd4142489070600a583efa6ace2 to your computer and use it in GitHub Desktop.
Get SSM parameters to ECS
#!/bin/sh
PARAMETERS=`aws ssm get-parameters-by-path --path ${1} --with-decryption`
for row in $(echo ${PARAMETERS} | jq -c '.Parameters' | jq -c '.[]'); do
KEY=$(basename $(echo ${row} | jq -c '.Name'))
VALUE=$(echo ${row} | jq -c '.Value')
KEY=`echo ${KEY} | tr -d '"'`
VALUE=`echo ${VALUE} | tr -d '"'`
export ${KEY}=${VALUE}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment