

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

# `AWSSupport-TroubleshootECSContainerInstance`
<a name="automation-aws-troubleshoot-ecs-container-instance"></a>

 **Description** 

 `AWSSupport-TroubleshootECSContainerInstance` Runbook 可協助您疑難排解無法向 Amazon ECS 叢集註冊的 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體。此自動化會檢閱執行個體的使用者資料是否包含正確的叢集資訊、執行個體描述檔是否包含必要的許可，以及網路組態問題。

**重要**  
 若要成功執行此自動化，Amazon EC2 執行個體的狀態必須為 `running` ，Amazon ECS 叢集狀態必須為 `ACTIVE` 。

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

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux、macOS、 Windows

**參數**
+ AutomationAssumeRole

  類型：字串

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

  類型：字串

  描述：（必要） 執行個體無法註冊的 Amazon ECS 叢集名稱。
+ InstanceId

  類型：字串

  描述：（必要） 您要疑難排解的 Amazon EC2 執行個體 ID。

**必要的 IAM 許可**

`AutomationAssumeRole` 參數需要下列動作才能成功使用 Runbook。
+  `ec2:DescribeIamInstanceProfileAssociations` 
+  `ec2:DescribeInstanceAttribute` 
+  `ec2:DescribeInstances` 
+  `ec2:DescribeNetworkAcls` 
+  `ec2:DescribeRouteTables` 
+  `ec2:DescribeSecurityGroups` 
+  `ec2:DescribeSubnets` 
+  `ec2:DescribeVpcEndpoints` 
+  `ec2:DescribeVpcs` 
+  `iam:GetInstanceProfile` 
+  `iam:GetRole` 
+  `iam:SimulateCustomPolicy` 
+  `iam:SimulatePrincipalPolicy` 

 **文件步驟** 

aws：executeScript：檢閱 Amazon EC2 執行個體是否符合向 Amazon ECS 叢集註冊所需的先決條件。