Created
October 29, 2018 21:36
-
-
Save nascimento/38900cd4142489070600a583efa6ace2 to your computer and use it in GitHub Desktop.
Get SSM parameters to ECS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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