Skip to content

Instantly share code, notes, and snippets.

@naoty
Created April 24, 2018 05:59
Show Gist options
  • Save naoty/29938927f0feae77b69b17c1ab4f3d9a to your computer and use it in GitHub Desktop.
Save naoty/29938927f0feae77b69b17c1ab4f3d9a to your computer and use it in GitHub Desktop.
Create .env file from SSM parameter store
#!/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
@almerindo
Copy link

Cool!!
Look : Creates a parameter store based on .env ;-)

https://gist.github.com/almerindo/45e1bb186c48c48b7e964c6a3ba0bc0e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment