

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

# 檢視連線詳細資訊
<a name="connections-view-details"></a>

您可以使用開發人員工具主控台或 AWS Command Line Interface (AWS CLI) 中的 **get-connection** 命令來檢視連線的詳細資訊。若要使用 AWS CLI，您必須已安裝最新版本的 AWS CLI 或更新至目前版本。如需詳細資訊，請參閱《*AWS Command Line Interface 使用者指南*》中的[安裝 AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)。

**檢視連線 (主控台)**

1. 開啟位於 [https://console.aws.amazon.com/codesuite/settings/connections](https://console.aws.amazon.com/codesuite/settings/connections) 的開發人員工具主控台。

1. 選擇 **Settings > Connections (設定 > 連線)**。

1. 選擇您要檢視的連線旁邊的按鈕，然後選擇 **View details (檢視詳細資訊)**。

1. 隨即會顯示連線的下列資訊：
   + 連線名稱。
   + 連線的供應商類型。
   + VPN 連線狀態。
   + 連線 ARN。
   + 如果連線是針對安裝式供應商 (例如 GitHub Enterprise Server) 建立的，則會顯示與連線相關聯的主機資訊。
   + 如果連線是針對安裝式供應商 (例如 GitHub Enterprise Server) 建立的，則會顯示與連線的主機相關聯的端點資訊。

1. 如果連線處於 **Pending (待定)** 狀態，若要完成連線，請選擇 **Update pending connection (更新待定連線)**。如需詳細資訊，請參閱[更新待定連線](connections-update.md)。

**檢視連線 (CLI)**
+ 在終端機或命令列上執行 **get-connection** 命令。例如，使用下列命令來檢視具有 `arn:aws:codestar-connections:us-west-2:account_id:connection/aEXAMPLE-8aad-4d5d-8878-dfcab0bc441f` ARN 值之連線的詳細資訊。

  ```
  aws codeconnections get-connection --connection-arn arn:aws:codeconnections:us-west-2:account_id:connection/aEXAMPLE-8aad-4d5d-8878-dfcab0bc441f
  ```

  如果成功，此命令會傳回連線詳細資訊。

  Bitbucket 連線的輸出範例：

  ```
  {
      "Connection": {
          "ConnectionName": "MyConnection",
          "ConnectionArn": "arn:aws:codeconnections:us-west-2:account_id:connection/cdacd948-EXAMPLE",
          "ProviderType": "Bitbucket",
          "OwnerAccountId": "account_id",
          "ConnectionStatus": "AVAILABLE"
      }
  }
  ```

  GitHub 連線的輸出範例：

  ```
  {
      "Connection": {
          "ConnectionName": "MyGitHubConnection",
          "ConnectionArn": "arn:aws:codeconnections:us-west-2:account_id:connection/ebcd4a13-EXAMPLE",
          "ProviderType": "GitHub",
          "OwnerAccountId": "account_id",
          "ConnectionStatus": "AVAILABLE"
      }
  }
  ```

  GitHub Enterprise Server 連線的輸出範例：

  ```
  {
      "Connection": {
          "ConnectionName": "MyConnection",
          "ConnectionArn": "arn:aws:codeconnections:us-west-2:account_id:connection/2d178fb9-EXAMPLE",
          "ProviderType": "GitHubEnterpriseServer",
          "OwnerAccountId": "account_id",
          "ConnectionStatus": "PENDING",
          "HostArn": "arn:aws:ccodeconnections:us-west-2:account_id:host/sdfsdf-EXAMPLE"
      }
  }
  ```