带有 SNS 的 AMS AMI 通知 - AMS 高级用户指南

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

带有 SNS 的 AMS AMI 通知

AMS 提供了 AMI 通知服务。您可以使用它订阅亚马逊简单通知服务 (SNS) Simple Notification Service 主题,该主题将在 AMS AMI 更新发布时通知您。您可以选择仅接收 AMIs 您使用的 AMS 的通知,也可以注册接收所有 AMS 的更新通知 AMIs。有关 SNS 主题的更多信息,请参阅什么是 Amazon 简单通知服务

每当 AMIs 发布时,我们都会向相应主题的订阅者发送通知;本节介绍如何订阅 AMS AMI 通知。

示例消息

{ "Type" : "Notification", "MessageId" : "example messageId", "TopicArn" : "arn:aws:sns:us-east-1:591688410472:customer-ams-windows2019", "Subject" : "New AMS AMIs are Now Available", "Message" : "{"v1": {"Message": "A new version of the AMS Amazon Machine Images has been released. You are now able to launch new EC2 stacks from these AMIs. Please use this time to update any dependencies such as CloudFormation or Autoscaling groups. Release Notes Windows - Contains latest Windows Patches: Microsoft Windows Server 2008 R2 Datacenter - (KB2819745, KB3018238, KB4507004, KB4507437) Microsoft Windows Server 2016 Datacenter Security Enhancedn - (KB4509091, KB4507459) Microsoft Windows Server 2016 Datacentern - (KB4509091, KB4507459) Microsoft Windows Server 2012 R2 Security Enhancedn - (KB3191564, KB3003057, KB3013172, KB3185319, KB4504418, KB4506996, KB4507463) Microsoft Windows Server 2012 R2 Standardn - (KB3003057, KB3013172, KB3185319, KB4504418, KB4506996, KB4507463) Linux - Contains latest Linux patches - All AMIs now force domainjoin-cli leave before domainjoin-cli join for better stability in the domain join process.", "images": {"images": {"image_name": "customer-ams-windows2019-2021.08-1", "image_id": "ami-05dfa45396fddaa5e"}}, "region": "us-east-1"}}", "Timestamp" : "2021-09-03T19:05:57.882Z", "SignatureVersion" : "1", "Signature" : "example sig", "SigningCertURL" : "example url", "UnsubscribeURL" : "example url" }

可能要订阅的 AMS AMI 主题:

  • 全部:使用customer-ams-all-amis。当任何 AMS AMIs 更新时,此主题订阅会通知您。

  • AMS AWS Linux AMIs:对于亚马逊 Linux,请使用customer-ams-amazon1customer-ams-amazon1-security-enhanced。对于亚马逊 Linux 2,使用customer-ams-amazon2customer-ams-amazon2-security-enhanced

  • AMS SUSE Linux AMIs:使用customer-ams-sles12customer-ams-sles15

  • AMS AWS RedHat AMIs:使用customer-ams-rhel8customer-ams-rhel8-security-enhancedcustomer-ams-rhel7、、customer-ams-rhel7-security-enhanced

  • AMS AWS CentOs AMIs:使用customer-ams-centos7customer-ams-centos7-security-enhanced

  • AMS Ubuntu AMIs:使用。customer-ams-ubuntu18

  • AMS AWS Windows AMIs:使用customer-ams-windows2019customer-ams-windows2019-security-enhancedcustomer-ams-windows2016、、customer-ams-windows2016-security-enhancedcustomer-ams-windows2012customer-ams-windows2012r2、、customer-ams-windows2012r2-security-enhancedcustomer-ams-windows2022

要使用亚马逊 SNS 控制台订阅 AMS 新的 AMI 通知,请执行以下操作:

  1. 打开 Amazon SNS 控制台以显示控制面板

  2. 在右上角,切换到您要订阅的 AWS 区域。 AMIs

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

  4. 提供以下信息:

    1. 主题 ARNarn:aws:sns:{REGION}:287847593866:{AMS_AMI_NAME}其中区域是所选的 AWS 区域(创建 SNS 通知的地方),AMS_AMI_NAME 是您想要通知的 AMI。示例:

      • 要订阅 AWS 区域 us-east-1 AMIs 中新 AMS Amazon Linux 的通知,请使用此主题 ARN =。 arn:aws:sns:us-east-1:287847593866:customer-ams-amazon1

      • 要订阅 AWS 区域 us-west-2 的新 AMS Window Server 2016 AMIs 的通知,请使用此主题 ARN = arn:aws:sns:us-west-2:287847593866:customer-ams-windows2016

    2. 对于协议,选择电子邮件

    3. 对于端点,输入可用来接收通知的电子邮件地址。我们建议使用通讯组列表而不是个人的电子邮件。

  5. 选择创建订阅

  6. 当您收到主题为 “AWS 通知-订阅确认” 的确认电子邮件时,请打开电子邮件并选择确认订阅以完成订阅。

注意

您不仅限于通过电子邮件发送该协议。有关其他可接受协议及其使用方法的信息,请参阅订阅

要使用 AWS SNS 控制台取消订阅 AMS 新 AMI 通知,请执行以下操作:

  1. 打开 Amazon SNS 控制台以显示控制面板

  2. 在导航栏中,切换到您选择的 AWS 区域。您必须使用要接收相应通知的 AWS 区域 AMIs。

  3. 在导航窗格中,选择 “订阅”,选择订阅,然后选择 “操作”-> “删除订阅”

  4. 当系统提示进行确认时,选择 Delete(删除)

要使用部署 | Ingestion | Stack from CloudFormation template | Create (ct-36cn2avfrrj9v) 订阅 AMS New AMI 通知,请执行以下操作:

  1. 要订阅 AmazonLinuxSubscription,请创建并保存执行参数 JSON 文件;此示例将其命名为 CreateSubscribeAmiParams .json:

    { "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "AmazonLinuxSubscription":{ "Type" : "AWS::SNS::Subscription", "Properties": { "TopicArn": "arn:aws:sns:{REGION}:287847593866:{AMS_AMI_NAME}", "Protocol": "email", "Endpoint": "username@yourdomain.com" } } } }
  2. 创建并保存包含以下内容的 RFC 参数 JSON 文件;此示例将其命名为 CreateSubscribeAmiRfc .json 文件:

    { "ChangeTypeId": "ct-36cn2avfrrj9v", "ChangeTypeVersion": "1.0", "Title": "cfn-ingest-subscribe-ami" }
  3. 创建 RFC,指定 CreateSubscribeAmiRfc 文件和 CreateSubscribeAmiParams 文件:

    aws amscm create-rfc --cli-input-json file://CreateSubscribeAmiRfc.json --execution-parameters file://CreateSubscribeAmiParams.json

    您在响应中收到新 RFC 的 ID,并可以使用它来提交和监控 RFC。在您提交之前,RFC 仍处于编辑状态且无法启动。

有关创建的示例 AMIs,请参阅创建 AMI

有关 AMIs 以编程方式消费的信息,请参阅EC2 堆栈:创建