Get the AMI and snapshot ID for a given EC2 image using awscli and jq. For example, if we have an image that has source=packer as a tag:
$ aws ec2 describe-images --filter Name=tag:source,Values=packer | jq ".Images.ImageId,.Images.BlockDeviceMappings.Ebs.SnapshotId"
The AWS command-line interface has --query which you can use instead of jq, although the syntax is slightly different (JMESPath) it eliminates the dependency. :)