订阅经 Amazon ECS优化的 AMI 更新通知 - Amazon Elastic Container Service
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

订阅经 Amazon ECS优化的 AMI 更新通知

重要

Amazon ECS-optimized Amazon Linux AMI 将于 2021 年 4 月 15 日弃用。此后,Amazon ECS 将继续为 AMI 提供关键和重要的安全更新,但不会增加对新功能的支持。

重要

对于经 Amazon ECS优化的 的 Linux 变体AMI,仅在新Amazon SNS部署 时发送Amazon ECS-optimized Amazon Linux AMI提醒。通常Amazon ECS-optimized Amazon Linux AMI,在部署新的 时,对于经 AMI优化的 的其他Amazon ECS每个 Linux 变体AMI,也会部署一个新的 ,尽管对于它们没有单独的Amazon SNS警报。有关更多信息,请参阅Amazon ECS-optimized AMIs.

经 Amazon ECS优化AMI的 接收Amazon ECS容器代理更改的定期更新、Docker 版本更新以及 Windows 或 Linux 内核安全更新。您可以订阅 Windows 和 Linux AMI Amazon SNS优化的 的Amazon ECS更新AMI主题,以在新的Amazon ECS经 优化的 AMI 可用时接收通知。通知以 Amazon SNS 支持的所有格式提供。

注意

用户账户必须拥有 sns::subscribe IAM 权限才能订阅 SNS 主题。

您可以为 Amazon SQS 队列订阅此通知主题,但必须使用与Amazon SNS主题位于同一 区域的主题 ARN。有关更多信息,请参阅 中的Amazon SQS教程:为 Amazon SNS 队列订阅 主题Amazon Simple Queue Service 开发人员指南

您也可以使用 AWS Lambda 函数在收到通知时触发事件。有关更多信息,请参阅 中的使用通知LambdaAmazon SNS调用 Amazon Simple Notification Service 开发人员指南 函数。

Amazon ECS经 优化的 Linux AMIs

每个区域的Amazon SNS经 优化的 ARNs 的 Linux Amazon ECS变体AMI的主题如下所示。

AWS区域

Amazon SNS 主题 ARN

us-east-1

arn:aws:sns:us-east-1:177427601217:ecs-optimized-amazon-ami-update

us-east-2

arn:aws:sns:us-east-2:177427601217:ecs-optimized-amazon-ami-update

us-west-1

arn:aws:sns:us-west-1:177427601217:ecs-optimized-amazon-ami-update

us-west-2

arn:aws:sns:us-west-2:177427601217:ecs-optimized-amazon-ami-update

ap-east-1

arn:aws:sns:ap-east-1:177427601217:ecs-optimized-amazon-ami-update

ap-northeast-1

arn:aws:sns:ap-northeast-1:177427601217:ecs-optimized-amazon-ami-update

ap-northeast-2

arn:aws:sns:ap-northeast-2:177427601217:ecs-optimized-amazon-ami-update

ap-southeast-1

arn:aws:sns:ap-southeast-1:177427601217:ecs-optimized-amazon-ami-update

ap-southeast-2

arn:aws:sns:ap-southeast-2:177427601217:ecs-optimized-amazon-ami-update

ap-south-1

arn:aws:sns:ap-south-1:177427601217:ecs-optimized-amazon-ami-update

ca-central-1

arn:aws:sns:ca-central-1:177427601217:ecs-optimized-amazon-ami-update

eu-west-1

arn:aws:sns:eu-west-1:177427601217:ecs-optimized-amazon-ami-update

eu-west-2

arn:aws:sns:eu-west-2:177427601217:ecs-optimized-amazon-ami-update

eu-west-3

arn:aws:sns:eu-west-3:177427601217:ecs-optimized-amazon-ami-update

eu-central-1

arn:aws:sns:eu-central-1:177427601217:ecs-optimized-amazon-ami-update

sa-east-1

arn:aws:sns:sa-east-1:177427601217:ecs-optimized-amazon-ami-update

在 AMI中订阅 AWS 管理控制台 更新通知电子邮件

  1. 通过以下网址打开 Amazon SNS 控制台:https://console.amazonaws.cn/sns/v3/home

  2. 在区域列表中,选择与要订阅的主题 ARN 相同的区域。此示例使用us-west-2区域。

  3. 在左侧导航窗格中,依次选择订阅创建订阅.

  4. 创建订阅对话框中,对于主题 ARN,粘贴Amazon ECS-optimized Amazon Linux AMI 更新主题 ARN:arn:aws:sns:us-west-2:177427601217:ecs-optimized-amazon-ami-update.

  5. 对于协议,选择电子邮件. 对于 Endpoint,键入您用于接收通知的电子邮件地址。

  6. 选择 Create subscription.

  7. 在您的电子邮件应用程序中,打开来自 AWS 通知的消息并打开链接以确认订阅。

    您的 Web 浏览器将显示来自 的确认响应。Amazon SNS.

使用 AMI 订阅 AWS CLI 更新通知电子邮件

  1. 使用 运行以下命令:AWS CLI:

    aws sns --region us-west-2 subscribe --topic-arn arn:aws:sns:us-west-2:177427601217:ecs-optimized-amazon-ami-update --protocol email --notification-endpoint your_email@your_domain.com
  2. 在您的电子邮件应用程序中,打开来自 AWS 通知的消息并打开链接以确认订阅。

    您的 Web 浏览器将显示来自 的确认响应。Amazon SNS.

Amazon SNS 消息格式

示例 AMI 更新通知消息如下所示:

{ "Type" : "Notification", "MessageId" : "e2534930-337d-5561-8636-1a2be5ba802e", "TopicArn" : "arn:aws:sns:us-west-2:917786371007:ecs-optimized-amazon-ami-update", "Message" : "{\"ECSAgent\":{\"ReleaseVersion\":\"1.17.2\"},\"ECSAmis\":[{\"ReleaseVersion\":\"2017.09.j\",\"AgentVersion\":\"1.17.2\",\"ReleaseNotes\":\"This AMI includes the latest ECS agent 1.17.2\",\"OsType\":\"linux\",\"OperatingSystemName\":\"Amazon Linux\",\"Regions\":{\"ap-northeast-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-bb5f13dd\"},\"ap-northeast-2\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-3b19b455\"},\"ap-south-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-9e91cff1\"},\"ap-southeast-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-f88ade84\"},\"ap-southeast-2\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-a677b6c4\"},\"ca-central-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-db48cfbf\"},\"cn-north-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-ca508ca7\"},\"eu-central-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-3b7d1354\"},\"eu-west-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-64c4871d\"},\"eu-west-2\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-25f51242\"},\"eu-west-3\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-0356e07e\"},\"sa-east-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-da2c66b6\"},\"us-east-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-cad827b7\"},\"us-east-2\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-ef64528a\"},\"us-gov-west-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-cc3cb7ad\"},\"us-west-1\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-29b8b249\"},\"us-west-2\":{\"Name\":\"amzn-ami-2017.09.j-amazon-ecs-optimized\",\"ImageId\":\"ami-baa236c2\"}}}]}", "Timestamp" : "2018-03-09T00:25:43.483Z", "SignatureVersion" : "1", "Signature" : "XWox8GDGLRiCgDOXlo/fG9Lu/88P8S0FL6M6oQYOmUFzkucuhoblsdea3BjqdCHcWR7qdhMPQnLpN7y9iBrWVUqdAGJrukAI8athvAS+4AQD/V/QjrhsEnlj+GaiW+ozAu006X6GopOzFGnCtPMROjCMrMonjz7Hpv/8KRuMZR3pyQYm5d4wWB7xBPYhUMuLoZ1V8YFs55FMtgQV/YLhSYuEu0BP1GMtLQauxDkscOtPP/vjhGQLFx1Q9LTadcQiRHtNIBxWL87PSI+BVvkin6AL7PhksvdQ7FAgHfXsit+6p8GyOvKCqaeBG7HZhR1AbpyVka7JSNRO/6ssyrlj1g==", "SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem", "UnsubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-2:917786371007:ecs-optimized-amazon-ami-update:8ad8798e-3bbf-4490-89b1-76136fca61dc" }

解析的 Message 值 (删除了转义引号) 如下所示:

{ "ECSAgent": { "ReleaseVersion": "1.17.2" }, "ECSAmis": [ { "ReleaseVersion": "2017.09.j", "AgentVersion": "1.17.2", "ReleaseNotes": "This AMI includes the latest ECS agent 1.17.2", "OsType": "linux", "OperatingSystemName": "Amazon Linux", "Regions": { "ap-northeast-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-bb5f13dd" }, "ap-northeast-2": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-3b19b455" }, "ap-south-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-9e91cff1" }, "ap-southeast-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-f88ade84" }, "ap-southeast-2": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-a677b6c4" }, "ca-central-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-db48cfbf" }, "cn-north-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-ca508ca7" }, "eu-central-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-3b7d1354" }, "eu-west-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-64c4871d" }, "eu-west-2": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-25f51242" }, "eu-west-3": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-0356e07e" }, "sa-east-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-da2c66b6" }, "us-east-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-cad827b7" }, "us-east-2": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-ef64528a" }, "us-gov-west-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-cc3cb7ad" }, "us-west-1": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-29b8b249" }, "us-west-2": { "Name": "amzn-ami-2017.09.j-amazon-ecs-optimized", "ImageId": "ami-baa236c2" } } } ] }

Amazon ECS经 优化的 Windows AMIs

AWS 为经 Amazon SNS ARNs优化的 Windows 的变体提供两个Amazon ECS主题AMI。一个主题将在新 Windows AMIs 发布时发送更新通知。另一个主题在以前发布的 Windows AMIs 变为私有时发送通知。有关订阅 Windows AMI 通知的更多信息,请参阅 中的订阅 Windows AMI Amazon EC2 用户指南(适用于 Windows 实例)通知