检索 Amazon EKS 优化版 Windows AMI ID
您可以使用编程方式,通过查询 Amazon Systems Manager Parameter Store API 来检索 Amazon EKS 优化版 AMI 的 Amazon Machine Image (AMI) ID。此参数使您无需手动查找 Amazon EKS 优化版 AMI ID。有关 Systems Manager Parameter Store API 的更多信息,请参阅 GetParameter。您的用户账户必须具有 ssm:GetParameter
IAM 权限才能检索 Amazon EKS 优化版 AMI 元数据。
您可以使用 Amazon CLI 或 Amazon Web Services Management Console 检索 AMI ID。
Amazon CLI – 您可以使用子参数
image_id
,通过以下命令检索推荐的最新的 Amazon EKS 优化版 Windows AMI 的镜像 ID。您可以将
替换为任何受支持的 Amazon EKS 版本,将1.21
替换为需要 AMI ID 的 Amazon EKS 支持的区域。请将region-code
替换为Core
Full
来查看 Windows Server 完整 AMI ID。您也可以将
仅替换为适用于2019
Core
版本的20H2
。此外,您只能使用版本 1.21 或更高的20H2
。aws ssm get-parameter --name /aws/service/ami-windows-latest/Windows_Server-
2019
-English-Core
-EKS_Optimized-1.21
/image_id --regionregion-code
--query "Parameter.Value" --output text输出示例:
ami-
ami-00a053f1635fffea0
-
Amazon Web Services Management Console – 您可以使用 URL 查询推荐的 Amazon EKS 优化版 AMI ID。该 URL 使用参数的 ID 的值打开 Amazon EC2 Systems Manager 控制台。在以下 URL 中,您可以将
1.21
替换为任何受支持的 Amazon EKS 版本,可将
替换为需要 AMI ID 的 Amazon EKS 支持的区域。请将region-code
替换为Core
Full
以查看 Windows Server 完整 AMI ID。您也可以将
仅替换为适用于2019
Core
版本的20H2
。此外,您只能使用版本 1.21 或更高的20H2
。https://console.aws.amazon.com/systems-manager/parameters/%252Faws%252Fservice%252Fami-windows-latest%252FWindows_Server-
2019
-English-Core
-EKS_Optimized-1.21
%252Fimage_id/description?region=region-code