

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

# `AWS-EnableCloudFormationSNSNotification`
<a name="AWS-EnableCloudFormationStackSNSNotification"></a>

 **Description** 

 `AWS-EnableCloudFormationSNSNotification` Runbook 會為您指定的 () 堆疊啟用 Amazon Simple Notification Service AWS CloudFormation (Amazon SNS CloudFormation) 通知。

 [執行此自動化 （主控台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWS-EnableCloudFormationStackSNSNotification) 

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux、macOS、 Windows

**參數**
+ AutomationAssumeRole

  類型：字串

  描述：（選用） 允許 Systems Manager Automation 代表您執行動作的 (IAM) 角色的 AWS Identity and Access Management Amazon Resource Name (ARN)。如果未指定角色，Systems Manager Automation 會使用啟動此 Runbook 的使用者許可。
+ StackArn

  類型：字串

  描述：（必要） 您要為其啟用 Amazon SNS 通知的 CloudFormation 堆疊 ARN 或名稱。
+ NotificationArn

  類型：字串

  描述：（必要） 您要與 CloudFormation 堆疊建立關聯的 Amazon SNS 主題 ARN。

**必要的 IAM 許可**

`AutomationAssumeRole` 參數需要下列動作才能成功使用 Runbook。
+ ssm:GetAutomationExecution
+ ssm:StartAutomationExecution
+ cloudformation:DescribeStacks
+ cloudformation:UpdateStack
+ kms:解密
+ kms:產生資料金鑰
+ sns:Publish
+ sqs:GetQueueAttributes

 **文件步驟** 
+ CheckCfnSnsLimits (`aws:executeScript`) - 驗證尚未與您指定的 CloudFormation 堆疊建立關聯的 Amazon SNS 主題數量上限。
+ EnableCfnSnsNotification (`aws:executeAwsApi`) - 啟用 CloudFormation 堆疊的 Amazon SNS 通知。
+ VerificationCfnSnsNotification (`aws:executeScript`) - 驗證堆疊是否已啟用 Amazon SNS 通知 CloudFormation 。

 **輸出** 

CheckCfnSnsLimits.NotificationArnList - 接收 CloudFormation 堆疊 Amazon SNS 通知的 ARNs 清單。

VerificationCfnSnsNotification.VerifySnsTopicsResponse - API 操作的回應，確認 CloudFormation 堆疊已啟用 Amazon SNS 通知。