检索 Amazon EKS 优化版 Bottlerocket 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 CLI 命令检索最新推荐的 Amazon EKS 优化版 Bottlerocket AMI 的镜像 ID。请将
替换为支持的版本,并将1.21
替换为您需要 AMI ID 的 Amazon EKS 支持的区域。region-code
aws ssm get-parameter --name /aws/service/bottlerocket/aws-k8s-
1.21
/x86_64/latest/image_id --regionregion-code
--query "Parameter.Value" --output text下面是一个示例输出。
ami-
068ed1c8e99b4810c
-
Amazon Web Services Management Console – 您可以使用 Amazon Web Services Management Console 中的 URL 查询推荐的 Amazon EKS 优化版 AMI ID。该 URL 使用参数的 ID 的值打开 Amazon EC2 Systems Manager 控制台。在以下 URL 中,将
替换为支持的版本,并将1.21
替换为需要 AMI ID 的 Amazon EKS 支持的区域。region-code
https://console.aws.amazon.com/systems-manager/parameters/aws/service/bottlerocket/aws-k8s-
1.21
/x86_64/latest/image_id/description?region=region-code