Skip to content

Instantly share code, notes, and snippets.

@dantheman213
Last active January 10, 2020 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dantheman213/18cbd10959da107a14977129612c00e8 to your computer and use it in GitHub Desktop.
Save dantheman213/18cbd10959da107a14977129612c00e8 to your computer and use it in GitHub Desktop.
Find list of SSM params with a keyword or phrase
# Get all SSM keys and values as JSON object per SSM key:
aws ssm describe-parameters --profile ${TARGET_ENV} | jq '{NextToken,Parameters:[ .Parameters | map(.Name) [] ] }' | jq -r '.Parameters | join("\n")' | while read line; do aws ssm get-parameter --name $line --profile ${TARGET_ENV} | jq -c '{Name: .Parameter.Name, Value: .Parameter.Value}'; done
# Get Keys by themselves per line raw
aws ssm describe-parameters | jq '{NextToken,Parameters:[ .Parameters | map(.Name) [] ] }' | jq -r '.Parameters | join("\n")'
# Do something in a bash for loop
aws ssm describe-parameters --profile preprod | jq '{NextToken,Parameters:[ .Parameters | map(.Name) [] ] }' | jq -r '.Parameters | join("\n")' | while read line; do aws ssm get-parameter --profile preprod --name $line; done
# Search for params that match a key name
aws ssm describe-parameters --region us-east-1 --profile production | jq '{NextToken,Parameters:[ .Parameters | map(.Name) [] | select(index("geo")) ] }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment