EC2 Snapshots

Find Snapshots older than an specific date. Won't work if AWS CLI is running on Windows:

$ aws ec2 describe-snapshots --region us-west-2 --query 'Snapshots[?StartTime <= `2017-08-30`].{id:SnapshotId}' --owner-ids 721933253214

Find Snapshots older than an specific date and that does not contain words on SnapshotId and Description:

$ aws ec2 describe-snapshots --region us-west-2 --query 'Snapshots[?StartTime <= `2015-08-30`]|[?contains(SnapshotId, `DND`) == `false`]|[?contains(Description, `DND`) == `false`].[SnapshotId,Description]' --output text

 

More at: https://opensourceconnections.com/blog/2015/07/27/advanced-aws-cli-jmespath-query/