Retrieving Amazon EKS optimized Windows 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).

Retrieving Amazon EKS optimized Windows 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. 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 Windows AMI with the following command by using the sub-parameter image_id. You can replace 1.29 with any supported Amazon EKS version and can replace region-code with an Amazon EKS supported Region for which you want the AMI ID. Replace Core with Full to see the Windows Server full AMI ID. For Kubernetes version 1.24 or later, you can replace 2019 with 2022 to see the Windows Server 2022 AMI ID.

aws ssm get-parameter --name /aws/service/ami-windows-latest/Windows_Server-2019-English-Core-EKS_Optimized-1.29/image_id --region region-code --query "Parameter.Value" --output text

An example output is as follows.

ami-1234567890abcdef0