

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

# `AWSSupport-TroubleshootCFNCustomResource`
<a name="automation-awssupport-TroubleshootCFNCustomResource"></a>

 **Description** 

 `AWSSupport-TroubleshootCFNCustomResource` Runbook 可協助診斷 AWS CloudFormation 堆疊在建立、更新或刪除自訂資源時失敗的原因。Runbook 會檢查用於自訂資源的服務權杖，以及傳回的錯誤訊息。檢閱自訂資源的詳細資訊後，執行手冊輸出會提供自訂資源堆疊行為和疑難排解步驟的說明。

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

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux、macOS、 Windows

**參數**
+ AutomationAssumeRole

  類型：字串

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

  類型：字串

  描述：（必要） 自訂資源失敗的 CloudFormation 堆疊名稱。

**必要的 IAM 許可**

`AutomationAssumeRole` 參數需要下列動作才能成功使用 Runbook。
+  `cloudformation:DescribeStacks` 
+  `cloudformation:DescribeStackEvents` 
+  `cloudformation:ListStackResources` 
+  `ec2:DescribeRouteTables` 
+  `ec2:DescribeNatGateways` 
+  `ec2:DescribeSecurityGroups` 
+  `ec2:DescribeVpcs` 
+  `ec2:DescribeVpcEndpoints` 
+  `ec2:DescribeSubnets` 
+  `logs:FilterLogEvents` 

 **文件步驟** 
+  `validateCloudFormationStack` - 驗證 CloudFormation 堆疊是否存在於相同的 AWS 帳戶 和 中 AWS 區域。
+  `checkCustomResource` - 分析 CloudFormation 堆疊、檢查失敗的自訂資源，並輸出有關如何對失敗的自訂資源進行故障診斷的資訊。