Skip to content

Instantly share code, notes, and snippets.

@julbrs
Last active April 13, 2022 17:31
Show Gist options
  • Save julbrs/2f2168a48ca2934e02d55ba68db46f95 to your computer and use it in GitHub Desktop.
Save julbrs/2f2168a48ca2934e02d55ba68db46f95 to your computer and use it in GitHub Desktop.
AWS CLI tricks

I will list here some AWS CLI tricks I use sometime ;)

List all own AMI with lastLaunchedTime on each AMI

This is possible since March, 9th 2022! See the corresponding AWS page here.

aws ec2 describe-images --owners self --query 'Images[*].[ImageId]' --output text | xargs -I {} aws ec2 describe-image-attribute --image-id {} --attribute lastLaunchedTime --query '[ImageId, LastLaunchedTime.Value]' --output text > ami_last_launch_time.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment