Help improve this page
To contribute to this user guide, choose the Edit this page on GitHub link that is located in the right pane of every page.
Retrieve recommended Amazon Linux AMI IDs
When deploying nodes, you can specify an ID for a pre-built Amazon EKS optimized Amazon Machine Image (AMI). To retrieve an AMI ID that fits your desired configuration, query the Amazon Systems Manager Parameter Store API. Using this API eliminates the need to manually look up Amazon EKS optimized AMI IDs. For more information, see GetParameter. The IAM principal that you use must have the ssm:GetParameter IAM permission to retrieve the Amazon EKS optimized AMI metadata.
You can retrieve the image ID of the latest recommended Amazon EKS optimized Amazon Linux AMI with the following command, which uses the sub-parameter image_id. Make the following modifications to the command as needed and then run the modified command:
-
Replace
<kubernetes-version>with an Amazon EKS supported version. -
Replace
ami-typewith one of the following options. For information about the types of Amazon EC2 instances, see Amazon EC2 instance types.-
Use
amazon-linux-2023/x86_64/standardfor Amazon Linux 2023 (AL2023)x86based instances. -
Use
amazon-linux-2023/arm64/standardfor AL2023 ARM instances, such as Amazon Gravitonbased instances. -
Use
amazon-linux-2023/x86_64/nvidiafor the latest approved AL2023 NVIDIAx86based instances. -
Use
amazon-linux-2023/arm64/nvidiafor the latest approved AL2023 NVIDIAarm64based instances. -
Use
amazon-linux-2023/x86_64/neuronfor the latest AL2023 Amazon Neuroninstances. -
Use
amazon-linux-2for Amazon Linux 2 (AL2)x86based instances. -
Use
amazon-linux-2-arm64for AL2 ARM instances, such as Amazon Gravitonbased instances. -
Use
amazon-linux-2-gpufor AL2 hardware acceleratedx86based instances for NVIDIA GPU, Inferentia, and Trainium based workloads.
-
-
Replace
<region-code>with an Amazon EKS supported Amazon Region for which you want the AMI ID.
aws ssm get-parameter --name /aws/service/eks/optimized-ami/<kubernetes-version>/<ami-type>/recommended/image_id \ --region <region-code> --query "Parameter.Value" --output text
Here’s an example command after placeholder replacements have been made.
aws ssm get-parameter --name /aws/service/eks/optimized-ami/1.31/amazon-linux-2023/x86_64/standard/recommended/image_id \ --regionus-west-2--query "Parameter.Value" --output text
An example output is as follows.
ami-1234567890abcdef0