

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

# `AWSSupport-TroubleshootCLBConnectivity`
<a name="automation-aws-troubleshootclbconnectivity"></a>

 **Description** 

 `AWSSupport-TroubleshootCLBConnectivity` Runbook 可協助您疑難排解 Classic Load Balancer (CLB) 和 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體之間的連線問題。此外，也會檢閱用戶端與 CLB 之間的連線問題。此 Runbook 也會檢閱 CLB 的運作狀態檢查，驗證是否遵循最佳實務，並為您建立故障診斷儀表板。或者，您可以將自動化輸出上傳到 Amazon Simple Storage Service (Amazon S3) 儲存貯體。不過，此 Runbook 不支援將輸出上傳到可公開存取的 S3 儲存貯體。建議您為此自動化建立臨時 S3 儲存貯體。

**重要**  
使用此 Runbook 可能會針對建立的儀表板產生費用。如需詳細資訊，請參閱 [Amazon CloudWatch 定價](https://aws.amazon.com/cloudwatch/pricing/) 

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

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux、macOS、 Windows

**參數**
+ AutomationAssumeRole

  類型：字串

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

  類型：字串

  有效值：最佳實務 \$1 連線問題 \$1 疑難排解儀表板

  描述：（必要） 您希望 Runbook 執行的操作。
+ LoadBalancerName

  類型：字串

  描述：（必要） CLB 的名稱。
+ S3Location

  類型：字串

  描述：（選用） 您要傳送自動化結果的 S3 儲存貯體名稱。不支援公開存取的儲存貯體。如果您的 S3 儲存貯體使用伺服器端加密，執行此自動化的使用者或角色必須具有 AWS KMS 金鑰的`kms:GenerateDataKey`許可。
+ S3LocationPrefix

  類型：字串

  描述：（選用） 您要上傳自動化輸出的 Amazon S3 金鑰字首 （子資料夾）。格式輸出會以下列格式儲存：amzn-s3-demo-bucket/*S3LocationPrefix*/\$1\$1*InvestigationType*\$1\$1\$1\$1\$1automation：*EXECUTION\$1ID*\$1\$1.txt。

**必要的 IAM 許可**

`AutomationAssumeRole` 參數需要下列動作才能成功使用 Runbook。
+  `ec2:DescribeInstances` 
+  `ec2:DescribeNetworkAcls` 
+  `ec2:DescribeNetworkInterfaces` 
+  `ec2:DescribeRouteTables` 
+  `ec2:DescribeSecurityGroups` 
+  `ec2:DescribeVpcAttribute` 
+  `ec2:DescribeVpcs` 
+  `ec2:DescribeSubnets` 
+  `elasticloadbalancing:DescribeLoadBalancers` 
+  `elasticloadbalancing:DescribeLoadBalancerPolicies` 
+  `elasticloadbalancing:DescribeInstanceHealth` 
+  `elasticloadbalancing:DescribeLoadBalancerAttributes` 
+  `iam:ListRoles` 
+  `cloudwatch:PutDashboard` 
+  `ssm:GetAutomationExecution` 
+  `ssm:StartAutomationExecution` 
+  `ssm:DescribeAutomationExecutions` 
+  `ssm:DescribeAutomationStepExecutions` 
+  `ssm:DescribeInstanceInformation` 
+  `ssm:DescribeInstanceProperties` 
+  `ssm:GetDocument` 
+  `ssm:ListCommands` 
+  `ssm:ListCommandInvocations` 
+  `ssm:ListDocuments` 
+  `ssm:SendCommand` 
+  `s3:GetBucketAcl` 
+  `s3:GetBucketPolicyStatus` 
+  `s3:GetPublicAccessBlock` 
+  `s3:PutObject` 

 **文件步驟** 
+  `aws:executeScript` - 驗證您在 `LoadBalancerName` 參數中指定的 CLB 是否存在。
+  `aws:branch` - 根據為 `InvestigationType` 參數指定的值進行分支。
+  `aws:executeScript` - 執行 CLB 的連線檢查。
+  `aws:executeScript` - 驗證 CLB 組態是否符合 Elastic Load Balancing 最佳實務。
+  `aws:executeScript` - 為您的 CLB 建立 Amazon CloudWatch 儀表板。
+  `aws:executeScript` - 使用自動化結果建立文字檔案，並將其上傳至您在 `S3Location` 參數中指定的 Amazon S3 儲存貯體。

 **輸出** 

RunBestPractices.Summary

RunConnectivityChecks.Summary

CreateTroubleshootingDashboard.Output

UploadOutputToS3.Output