Skip to content

Instantly share code, notes, and snippets.

View stephanfuchs's full-sized avatar

Stephan Fuchs stephanfuchs

View GitHub Profile
@stephanfuchs
stephanfuchs / awscli_jq_tricks.sh
Created June 10, 2024 07:06 — forked from weyderfs/awscli_jq_tricks.sh
AWS CLI JQ Tricks - Outputs likes to export for CSV file
#List EC2 AMI's group by ID and TagName handling with null values
aws ec2 describe-images --owners <owner-id> --region sa-east-1 | jq '.Images[] | [.ImageId,.Tags[]?.Value] | join(";")'
#List EC2 Instances group by Tag Name and InstanceType
aws ec2 describe-instances --region sa-east-1 | jq '.Reservations[].Instances[] | [.InstanceType,.Tags[].Value] | join(";")'
#List EC2 Snapshots
aws ec2 describe-snapshots --region <the-region> --owner-id <123456789> | jq -r '.Snapshots[] | [.SnapshotId,.Description] | join(" ")' | sort
#List ECS Clusters by Name