-
-
Save takayamaki/9f8d567de94d3ea860967c27c0de8c75 to your computer and use it in GitHub Desktop.
Extract parameter to environment variable from parameter store using aws cli and jq
This file contains 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/bash | |
if [ -v $AWS_PARAMETER_STORE_REGION ] || [ -v $AWS_PARAMETER_STORE_PREFIX ]; then | |
exit 0 | |
fi | |
aws ssm --region $AWS_PARAMETER_STORE_REGION get-parameters-by-path --with-decryption --path $AWS_PARAMETER_STORE_PREFIX | jq -r -c '.Parameters[]|"export \(.Name|split("/")[-1])=\"\(.Value)\""' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment