./script.sh us-east-1 /my/param/prefix/ example.env
Created
November 7, 2023 05:04
-
-
Save benrowe/3fb242cebdd3758c454735361fdbdc37 to your computer and use it in GitHub Desktop.
Convert aws SSM params to .env file
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
#!/usr/bin/env bash | |
region=$1 | |
path=$2 | |
output=$3 | |
aws ssm get-parameters-by-path \ | |
--region $region \ | |
--path $path \ | |
--query "Parameters[*].{Name:Name,Value:Value}" \ | |
--with-decryption | \ | |
jq -r ".[] | \"\(.Name|split(\"/\")|.[-1])=\(.Value)\"" | \ | |
sort > $output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment