Created
April 24, 2018 05:59
-
-
Save naoty/29938927f0feae77b69b17c1ab4f3d9a 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
Cool!!
Look : Creates a parameter store based on .env ;-)
https://gist.github.com/almerindo/45e1bb186c48c48b7e964c6a3ba0bc0e