

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

# `AWSConfigRemediation-EnableVPCFlowLogsToCloudWatch`
<a name="automation-aws-enable-flow-logs-cw"></a>

 **Description** 

 `AWSConfigRemediation-EnableVPCFlowLogsToCloudWatch` Runbook 會將將流程日誌資料發佈至 Amazon Simple Storage Service (Amazon S3) 的現有 Amazon VPC 流程日誌取代為您指定的 Amazon CloudWatch Logs (CloudWatch Logs) 日誌群組發佈流程日誌資料。

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

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux、macOS、 Windows

**參數**
+ AutomationAssumeRole

  類型：字串

  描述：（必要） (IAM) 角色的 AWS Identity and Access Management Amazon Resource Name (ARN)，允許 Systems Manager Automation 代表您執行動作。
+ DestinationLogGroup

  類型：字串

  描述：（必要） 您要發佈流程日誌資料的 CloudWatch Logs 日誌群組名稱。
+ DeliverLogsPermissionArn

  類型：字串

  描述：（必要） 您要使用的 AWS Identity and Access Management (IAM) 角色 ARN，可提供 Amazon Elastic Compute Cloud (Amazon EC2) 將流程日誌資料發佈至 CloudWatch Logs 的必要許可。
+ FlowLogId

  類型：字串

  描述：（必要） 發佈至您要取代之 Amazon S3 的流程日誌 ID。
+ MaxAggregationInterval

  類型：整數

  有效值：60 \$1 600

  描述：（選用） 擷取封包流程並將其彙總至流程日誌記錄的最大時間間隔，以秒為單位。
+ TrafficType

  類型：字串

  有效值：接受 \$1 拒絕 \$1 ALL

  描述：（必要） 您要記錄和發佈的流程日誌資料類型。

**必要的 IAM 許可**

`AutomationAssumeRole` 參數需要下列動作才能成功使用 Runbook。
+  `ssm:StartAutomationExecution` 
+  `ssm:GetAutomationExecution` 
+  `ec2:CreateFlowLogs` 
+  `ec2:DeleteFlowLogs` 
+  `ec2:DescribeFlowLogs` 

 **文件步驟** 
+  `aws:executeAwsApi` - 從您在 `FlowLogId` 參數中指定的值收集 VPC 的詳細資訊。
+  `aws:executeAwsApi` - 根據您為 Runbook 參數指定的值建立流程日誌。
+  `aws:assertAwsResourceProperty` - 驗證新建立的流程日誌發佈至 CloudWatch Logs。
+  `aws:executeAwsApi` - 刪除發佈至 Amazon S3 的流程日誌。
+  `aws:executeScript` - 確認發佈至 Amazon S3 的流程日誌已刪除。