Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filter aws cli resource lists for a specific single attribute value
# Lambda ARNs
aws lambda list-functions | jq '.Functions[].FunctionArn'
# multiple properies: outputs on separate lines
aws lambda list-functions | jq -r '.Functions[] | .FunctionArn, .FunctionName'
# multiple properties as arrays
aws lambda list-functions | jq -r '.Functions[] | [.FunctionArn, .FunctionName]'
# multiple properties as arrays, converted to csv
aws lambda list-functions | jq -r '.Functions[] | [.FunctionArn, .FunctionName]. | @csv'
# or, map selected attribtues to csv list
aws lambda list-functions | jq -r '.Functions[] | {FunctionArn, FunctionName} | to_entries | map(.value) | @csv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment