

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

# 步驟函數
<a name="automation-ref-sfn"></a>

 AWS Systems Manager 自動化為 AWS Step Functions （步驟函數） 提供預先定義的 Runbook。如需有關執行手冊的詳細資訊，請參閱 [Working with runbooks](https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-documents.html)。如需如何檢視 Runbook 內容的詳細資訊，請參閱 [檢視 Runbook 內容](automation-runbook-reference.md#view-automation-json)。

**Topics**
+ [`AWS-EnableStepFunctionsStateMachineLogging`](aws-enablestepfunctionsstatemachinelogging.md)

# `AWS-EnableStepFunctionsStateMachineLogging`
<a name="aws-enablestepfunctionsstatemachinelogging"></a>

 **Description** 

`AWS-EnableStepFunctionsStateMachineLogging` Runbook 會在您指定的 AWS Step Functions 狀態機器上啟用或更新記錄。最低記錄層級必須設定為 `ALL`、 `ERROR`或 `FATAL`。

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

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux、macOS、 Windows

**參數**
+ AutomationAssumeRole

  類型：字串

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

  類型：字串

  有效值： ALL \$1 ERROR \$1 FATAL

  描述：（必要） 您要啟用加密的 Amazon SQS 佇列 URL。
+ LogGroupArn

  類型：字串

  描述：（必要） 您要傳送狀態機器日誌的 Amazon CloudWatch Logs 日誌群組 ARN。
+ StateMachineArn

  類型：字串

  描述：（必要） 您要啟用登入之狀態機器的 ARN。
+ IncludeExecutionData

  類型：布林值

  預設：False

  描述：（選用） 判斷日誌中是否包含執行資料。
+ TracingConfiguration

  類型：布林值

  預設：False

  描述：（選用） 判斷是否啟用 AWS X-Ray 追蹤。

**必要的 IAM 許可**

`AutomationAssumeRole` 參數需要下列動作才能成功使用 Runbook。
+ `ssm:GetAutomationExecution`
+ `ssm:StartAutomationExecution`
+ `states:DescribeStateMachine`
+ `states:UpdateStateMachine`

 **文件步驟** 
+  `EnableStepFunctionsStateMachineLogging (aws:executeAwsApi)` - 使用指定的記錄組態更新指定的狀態機器。
+  `VerifyStepFunctionsStateMachineLoggingEnabled (aws:assertAwsResourceProperty)` - 確認已為指定的狀態機器啟用記錄。

 **輸出** 
+ EnableStepFunctionsStateMachineLogging.Response - UpdateStateMachine API 呼叫的回應。