Retrieving Amazon EKS optimized Amazon Linux AMI IDs - Amazon EKS
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Help improve this page

Want to contribute to this user guide? Scroll to the bottom of this page and select Edit this page on GitHub. Your contributions will help make our user guide better for everyone.

Retrieving Amazon EKS optimized Amazon Linux AMI IDs

You can programmatically retrieve the Amazon Machine Image (AMI) ID for Amazon EKS optimized AMIs by querying the Amazon Systems Manager Parameter Store API. This parameter eliminates the need for you to manually look up Amazon EKS optimized AMI IDs. For more information about the Systems Manager Parameter Store API, see GetParameter.

To retrieve an AMI ID for Amazon EKS optimized AMIs using the Amazon CLI
  1. Determine the region your node instance will be deployed in, such as us-east-1.

  2. Determine the type of AMI you need. For information about the types of Amazon EC2 instances, see Instance Types.

    • amazon-linux-2 is for Amazon Linux 2 (AL2) x86 based instances.

    • amazon-linux-2-arm64 is for AL2 ARM instances, such as Amazon Graviton based instances.

    • amazon-linux-2-gpu is for AL2 GPU accelerated instances.

    • amazon-linux-2023/x86_64/standard is for Amazon Linux 2023 (AL2023) x86 based instances.

    • amazon-linux-2023/arm64/standard is for AL2023 ARM instances.

  3. Determine the Kubernetes version of the cluster your node will be attached to, such as 1.30.

  4. Run the following Amazon CLI command to retrieve the appropriate AMI ID. Replace the Amazon Web Services Region, Kubernetes version, and platform as appropriate. You must be logged into the Amazon CLI using an IAM principal that has the ssm:GetParameter IAM permission to retrieve the Amazon EKS optimized AMI metadata.

    aws ssm get-parameter --name /aws/service/eks/optimized-ami/1.30/amazon-linux-2/recommended/image_id \ --region region-code --query "Parameter.Value" --output text

    An example output is as follows.

    ami-1234567890abcdef0