-
-
Save petronetto/01f8a5c6aa176f9bc7ae513ceb930066 to your computer and use it in GitHub Desktop.
Create .env file from SSM parameter store
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 -e | |
aws ssm get-parameters-by-path \ | |
--path "/myapp/" \ | |
--with-decryption \ | |
--query "Parameters[*].[Name,Value]" \ | |
--output text | | |
while read line | |
do | |
name=$(echo ${line} | cut -f 1 -d ' ' | sed -e 's/\/myapp\///g') | |
value=$(echo ${line} | cut -f 2 -d ' ') | |
echo "${name}=${value}" >> .env | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment