

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

# Amazon SNS
<a name="automation-ref-sns"></a>

 AWS Systems Manager Automation 为 Amazon 简单通知服务提供了预定义的运行手册。有关运行手册的更多信息，请参阅[使用运行手册](https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-documents.html)。有关如何查看运行手册内容的信息，请参阅 [查看运行手册内容](automation-runbook-reference.md#view-automation-json)。

**Topics**
+ [`AWS-EnableSNSTopicDeliveryStatusLogging`](aws-enable-sns-topic-delivery-status-logging.md)
+ [`AWSConfigRemediation-EncryptSNSTopic`](automation-aws-encrypt-sns-topic.md)
+ [`AWS-PublishSNSNotification`](automation-aws-publishsnsnotification.md)

# `AWS-EnableSNSTopicDeliveryStatusLogging`
<a name="aws-enable-sns-topic-delivery-status-logging"></a>

 **描述** 

 该`AWS-EnableSNSTopicDeliveryStatusLogging`运行手册为亚马逊 Data Firehose、Lambda 或`HTTP`亚马逊简单队列服务 (Amazon S `Platform application` QS) 终端节点配置传输状态日志。这样，Amazon SNS 就可以将失败的警报以及成功警报通知的示例百分比记录到亚马逊。 CloudWatch如果已经为该主题配置了交付状态日志，则运行手册将使用您为输入参数指定的新值替换现有配置。

 [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWS-EnableSNSTopicDeliveryStatusLogging) 

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ AutomationAssumeRole

  类型：字符串

  描述：（可选）允许 Systems Manager Automation 代表您执行操作 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
+ EndpointType

  类型：字符串

  有效值：
  + HTTP
  + Firehose
  + Lambda
  + 应用程序
  + SQS

  描述：（必填）您要记录其传输状态通知消息的 Amazon SNS 主题终端节点的类型。
+ TopicArn

  类型：字符串

  描述：（必填）您要为其配置传送状态日志的 Amazon SNS 主题的 ARN。
+ SuccessFeedbackRoleArn

  类型：字符串

  描述：（必填）Amazon SNS 用于向其发送成功通知消息的日志的 IAM 角色的 ARN。 CloudWatch
+ SuccessFeedbackSampleRate

  类型：字符串

  有效值：0-100

  描述：（必填）指定 Amazon SNS 主题的成功采样消息的百分比。
+ FailureFeedbackRoleArn

  类型：字符串

  描述：（必填）Amazon SNS 用于向其发送失败通知消息日志的 IAM 角色的 ARN。 CloudWatch

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+  `ssm:StartAutomationExecution` 
+  `ssm:GetAutomationExecution` 
+  `iam:PassRole` 
+  `sns:GetTopicAttributes` 
+  `sns:SetTopicAttributes` 

 **文档步骤** 
+  `aws:executeAwsApi`-将`SuccessFeedbackRoleArn`参数的值应用于 Amazon SNS 主题。
+  `aws:executeAwsApi`-将`SuccessFeedbackSampleRate`参数的值应用于 Amazon SNS 主题。
+  `aws:executeAwsApi`-将`FailureFeedbackRoleArn`参数的值应用于 Amazon SNS 主题。
+  `aws:executeScript`-确认已在 Amazon SNS 主题上启用配送状态记录。

 **输出** 

VerifyDeliveryStatusLoggingEnabled。 GetTopicAttributesResponse -来自 `GetTopicAttributes` API 操作的响应。

VerifyDeliveryStatusLoggingEnabled。 VerifyDeliveryStatusLoggingEnabled -表示成功验证传送状态记录的消息。

# `AWSConfigRemediation-EncryptSNSTopic`
<a name="automation-aws-encrypt-sns-topic"></a>

 **描述** 

 该操作`AWSConfigRemediation-EncryptSNSTopic`手册允许对您使用 () 客户托管密钥指定的亚马逊简单通知服务 (Amazon SNS) Simple Notification Service 主题进行 AWS Key Management Service 加密。AWS KMS此运行手册应仅用作基准，以确保根据建议的最低安全性最佳实践对 Amazon SNS 主题进行加密。我们建议使用不同的客户托管密钥对多个主题进行加密。

 [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWSConfigRemediation-EncryptSNSTopic) 

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ AutomationAssumeRole

  类型：字符串

  描述：（必需）允许 Systems Manager Automation 代表您执行操作的 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。
+ KmsKeyArn

  类型：字符串

  描述：（必需）要用于加密 Amazon SNS 主题的 AWS KMS 客户托管密钥的 Amazon 资源名称（ARN）。
+ TopicArn

  类型：字符串

  描述：（必需）要加密的 Amazon SNS 主题的 ARN。

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+  `ssm:StartAutomationExecution` 
+  `ssm:GetAutomationExecution` 
+  `sns:GetTopicAttributes` 
+  `sns:SetTopicAttributes` 

 **文档步骤** 
+  `aws:executeAwsApi` - 加密您在 `TopicArn` 参数中指定的 Amazon SNS 主题。
+  `aws:assertAwsResourceProperty` - 确认已对 Amazon SNS 主题启用加密。

# `AWS-PublishSNSNotification`
<a name="automation-aws-publishsnsnotification"></a>

 **描述** 

向 Amazon SNS 发布一个通知。

 [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWS-PublishSNSNotification) 

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ AutomationAssumeRole

  类型：字符串

  描述：（可选）允许 Systems Manager Automation 代表您执行操作 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
+ Message

  类型：字符串

  描述：（必需）包含在 SNS 通知中的消息。
+ TopicArn

  类型：字符串

  描述：（必需）向其发布通知的 SNS 主题的 ARN。