Last active
March 21, 2024 15:51
-
-
Save r115/3c78e54af4c8da75a7650a0cf170a315 to your computer and use it in GitHub Desktop.
Aws Parameter Store To System Environment Variable
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
aws ssm get-parameters-by-path \ | |
--path /apps/prod --region us-east-1 \ | |
| jq '.Parameters[] |.Name, .Value' \ | |
| xargs -n2 -d'\n' | tr -s '[:blank:]' '=' \ | |
| sed 's/"//g' \ | |
| sed 's@.*/@@' \ | |
| sed 's/^/export /' > \ | |
| sudo tee /etc/profile.d/my_envs.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stackoverflow-fu
Not anywhere near efficient but it delivers
Tested on AmazonLinux