hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

Import Parameter Store values directly into export statement #217

Open MikeTheCanuck opened 5 years ago

MikeTheCanuck commented 5 years ago

Classic "solution looking for a problem to solve" - I found this code snippet in my travels, and it rang a bell of a scenario where I didn't know a good way to pull in Parameter Store values directly into an export statement:

export POSTGRES_PASSWORD=$(aws ssm get-parameter --name "/${ENV}/database.password" --with-decryption | python -c "import json,sys;val=json.load(sys.stdin)['Parameter']['Value'];print(val);") || exit 1

It's possible this isn't needed, but I'll leave it as a tickler for "future us" in case it helps later.