|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * machine_management/adding-rhel-compute.adoc |
| 4 | +// * machine_management/more-rhel-compute.adoc |
| 5 | + |
| 6 | +[id="rhel-images-aws_{context}"] |
| 7 | += Listing latest available RHEL images on AWS |
| 8 | + |
| 9 | +AMI IDs correspond to native boot images for AWS. Because an AMI must exist before the EC2 instance is provisioned, you will need to know the AMI ID before configuration. The link:https://aws.amazon.com/cli/[AWS Command Line Interface (CLI)] is used to list the available {op-system-base-full} image IDs. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You have installed the AWS CLI. |
| 14 | + |
| 15 | +.Procedure |
| 16 | + |
| 17 | +* Use this command to list {op-system-base} 7.9 Amazon Machine Images (AMI): |
| 18 | ++ |
| 19 | +[source,terminal] |
| 20 | +---- |
| 21 | +$ aws ec2 describe-images --owners 309956199498 \ <1> |
| 22 | +--query 'sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]' \ <2> |
| 23 | +--filters "Name=name,Values=RHEL-7.9*" \ <3> |
| 24 | +--region us-east-1 \ <4> |
| 25 | +--output table <5> |
| 26 | +---- |
| 27 | ++ |
| 28 | +<1> The `--owners` command option shows Red Hat images based on the account ID `309956199498`. |
| 29 | ++ |
| 30 | +[IMPORTANT] |
| 31 | +==== |
| 32 | +This account ID is required to display AMI IDs for images that are provided by Red Hat. |
| 33 | +==== |
| 34 | ++ |
| 35 | +<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. |
| 36 | +<3> The `--filter` command option sets which version of {op-system-base} is shown. In this example, since the filter is set by `"Name=name,Values=RHEL-7.9*"`, then {op-system-base} 7.9 AMIs are shown. |
| 37 | +<4> The `--region` command option sets where the region where an AMI is stored. |
| 38 | +<5> The `--output` command option sets how the results are displayed. |
| 39 | + |
| 40 | +[NOTE] |
| 41 | +==== |
| 42 | +When creating a {op-system-base} compute machine for AWS, ensure that the AMI is {op-system-base} 7.9. |
| 43 | +==== |
| 44 | ++ |
| 45 | +.Example output |
| 46 | +[source,terminal] |
| 47 | +---- |
| 48 | +---------------------------------------------------------------------------------------------------------- |
| 49 | +| DescribeImages | |
| 50 | ++---------------------------+----------------------------------------------------+-----------------------+ |
| 51 | +| 2020-05-13T09:50:36.000Z | RHEL-7.9_HVM_BETA-20200422-x86_64-0-Hourly2-GP2 | ami-038714142142a6a64 | |
| 52 | +| 2020-09-18T07:51:03.000Z | RHEL-7.9_HVM_GA-20200917-x86_64-0-Hourly2-GP2 | ami-005b7876121b7244d | |
| 53 | +| 2021-02-09T09:46:19.000Z | RHEL-7.9_HVM-20210208-x86_64-0-Hourly2-GP2 | ami-030e754805234517e | |
| 54 | ++---------------------------+----------------------------------------------------+-----------------------+ |
| 55 | +---- |
0 commit comments