

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

# 列出連線
<a name="connections-list"></a>

您可以使用開發人員工具主控台或 AWS Command Line Interface (AWS CLI) 中的 **list-connections** 命令來檢視帳戶中的連線清單。

## 列出連線 (主控台)
<a name="connections-list-console"></a>

**列出連線**

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

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

1. 檢視連線的名稱、狀態和 ARN。

## 列出連線 (CLI)
<a name="connections-list-cli"></a>

您可以使用 AWS CLI 列出與第三方程式碼儲存庫的連線。針對與主機資源相關聯的連線 (例如連至 GitHub Enteprise Server 的連線)，輸出會額外傳回主機 ARN。

若要這麼做，請使用 **list-connections** 命令。

**列出連線**
+ 開啟終端機 (Linux、macOS 或 Unix) 或命令提示字元 (Windows)，然後使用 AWS CLI 執行**list-connections**命令。

  ```
  aws codeconnections list-connections --provider-type Bitbucket
  --max-results 5 --next-token: next-token
  ```

  此命令會傳回下列輸出。

  ```
  {
       "Connections": [
           {
               "ConnectionName": "my-connection",
               "ProviderType": "Bitbucket",
               "Status": "PENDING",
               "ARN": "arn:aws:codeconnections:us-west-2:account_id:connection/aEXAMPLE-8aad-4d5d-8878-dfcab0bc441f",
               "OwnerAccountId": "account_id"
           },
           {
               "ConnectionName": "my-other-connection",
               "ProviderType": "Bitbucket",
               "Status": "AVAILABLE",
               "ARN": "arn:aws:codeconnections:us-west-2:account_id:connection/aEXAMPLE-8aad-4d5d-8878-dfcab0bc441f",
               "OwnerAccountId": "account_id"
            },
        ],
       "NextToken": "next-token"
  }
  ```