检索 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。您使用的 IAM 主体必须具有 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.25替换为您需要 AMI ID 的 Amazon EKS 支持的区域。region-codeaws ssm get-parameter --name /aws/service/bottlerocket/aws-k8s-1.25/x86_64/latest/image_id --regionregion-code--query "Parameter.Value" --output text输出示例如下。
ami-
1234567890abcdef0 -
Amazon Web Services Management Console – 您可以使用 Amazon Web Services Management Console 中的 URL 查询推荐的 Amazon EKS 优化版 AMI ID。该 URL 使用参数的 ID 的值打开 Amazon EC2 Systems Manager 控制台。在以下 URL 中,将
替换为支持的版本,并将1.25替换为需要 AMI ID 的 Amazon EKS 支持的区域。region-codehttps://console.aws.amazon.com/systems-manager/parameters/aws/service/bottlerocket/aws-k8s-1.25/x86_64/latest/image_id/description?region=region-code