$ aws ec2 describe-images --owners 309956199498 \ (1)
--query 'sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]' \ (2)
--filters "Name=name,Values=RHEL-8.4*" \ (3)
--region us-east-1 \ (4)
--output table (5)
1 | The --owners command option shows Red Hat images based on the account ID 309956199498 .
|
||
2 | The --query command option sets how the images are sorted with the parameters 'sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]' . In this case, the images are sorted by the creation date, and the table is structured to show the creation date, the name of the image, and the AMI IDs. |
||
3 | The --filter command option sets which version of RHEL is shown. In this example, since the filter is set by "Name=name,Values=RHEL-8.4*" , then RHEL 8.4 AMIs are shown. |
||
4 | The --region command option sets where the region where an AMI is stored. |
||
5 | The --output command option sets how the results are displayed. |