使用 SNS 的 AMS AMI 通知 - AMS 進階使用者指南

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用 SNS 的 AMS AMI 通知

AMS 提供 AMI 通知服務。您可以使用它來訂閱 Amazon Simple Notification Service (SNS) 主題,在 AMS AMI 更新發佈時通知您。您可以選擇只接收您使用的 AMS AMIs 的通知,也可以註冊以接收所有 AMS AMIs的更新通知。如需 SNS 主題的詳細資訊,請參閱什麼是 Amazon Simple Notification Service?

每當 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 主題:

  • ALL:使用 customer-ams-all-amis。本主題訂閱會在任何 AMS AMIs 更新時通知您。

  • AMS AWS Linux AMIs:對於 Amazon Linux,請使用 customer-ams-amazon1customer-ams-amazon1-security-enhanced。對於 Amazon 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-rhel7customer-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-windows2016customer-ams-windows2016-security-enhancedcustomer-ams-windows2012customer-ams-windows2012r2customer-ams-windows2012r2-security-enhanced、、customer-ams-windows2022

若要使用 Amazon SNS 主控台訂閱 AMS 新 AMI 通知:

  1. 開啟儀表板的 Amazon SNS 主控台https://console.aws.amazon.com/sns/v2/home

  2. 在右上角,將您訂閱的 AMIs 變更為 AWS 區域。

  3. 在左側導覽窗格中,選擇訂閱,然後選擇建立訂閱

  4. 請提供下列資訊:

    1. 主題 ARNarn:aws:sns:{REGION}:287847593866:{AMS_AMI_NAME}其中 REGION 是選取的 AWS 區域 (SNS 通知的建立位置),而 AMS_AMI_NAME 是您想要通知的 AMI。範例:

      • 若要訂閱 AWS 區域 us-east-1 中新 AMS Amazon Linux AMIs 的通知,請使用此主題 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. 針對 Endpoint (端點),請輸入可用於接收通知的電子郵件地址。我們建議分發清單,而不是個人的電子郵件。

  5. 選擇建立訂閱

  6. 當您收到主旨行為「AWS Notification - Subscription Confirmation」的確認電子郵件時,請開啟電子郵件,然後選擇確認訂閱以完成您的訂閱。

注意

您不限於通訊協定的電子郵件。如需其他可接受通訊協定及其使用方式的資訊,請參閱訂閱

若要使用 AWS SNS 主控台取消訂閱 AMS 新 AMI 通知:

  1. 開啟儀表板的 Amazon SNS 主控台https://console.aws.amazon.com/sns/v2/home

  2. 在導覽列中,將 變更為您選擇的 AWS 區域。您必須使用要接收對應 AMIs 區域。

  3. 在導覽窗格中,選擇訂閱,選擇訂閱,然後選擇動作 -> 刪除訂閱

  4. 出現確認提示時,請選擇刪除

若要使用部署 | 擷取 | CloudFormation 範本的堆疊 | 建立 (ct-36cn2avfrrj9v) 訂閱 AMS 新 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 堆疊:建立