

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

# 檢視代理
<a name="rds-proxy-viewing"></a>

 建立一或多個 RDS 代理後，您可以在 AWS 管理主控台、AWS CLI 或 RDS API 中進行檢視和管理。您可以檢閱其組態詳細資訊、監控效能，並判斷哪些代理需要修改或刪除。

若要讓資料庫應用程式透過代理路由流量，您必須在連線字串中指定代理端點。

## 主控台
<a name="rds-proxy-viewing.console"></a>

**在主控台檢視代理**

1. 登入 AWS 管理主控台，開啟位於 [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/) 的 Amazon RDS 主控台。

1. 在導覽窗格中，選擇 **Proxies** (代理)。

1. 選取代理名稱以檢視其詳細資訊。

1. 在詳細資訊頁面上，**目標群組**區段會顯示代理程式如何連結至特定 RDS 資料庫執行個體。您可以導覽至預設目標群組頁面，以深入了解此關聯，包括在建立代理期間定義的組態設定。這些設定包括最大連線百分比、連線借用逾時、引擎系列，以及工作階段鎖定篩選條件。

## CLI
<a name="rds-proxy-viewing.cli"></a>

 若要使用 CLI 檢視代理，請使用 [describe-db-proxies](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-proxies.html) 命令。根據預設，要求會傳回您AWS帳戶擁有的所有代理。若要查看單一代理的詳細資料，請使用 `--db-proxy-name` 參數指定其名稱。

```
aws rds describe-db-proxies [--db-proxy-name proxy_name]
```

 若要檢視與代理相關聯的其他資訊，請使用下列命令。

```
aws rds describe-db-proxy-target-groups  --db-proxy-name proxy_name

aws rds describe-db-proxy-targets --db-proxy-name proxy_name
```

 使用下列命令序列查看與代理關聯的事物的詳細資訊：

1.  若要取得代理清單，請執行 [describe-db-proxies](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-proxies.html)。

1.  若要顯示連線參數 (例如代理可以使用的連線百分比上限)，請執行 [describe-db-proxy-target-groups](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-proxy-target-groups.html) `--db-proxy-name`。使用代理的名稱做為參數值。

1.  若要查看與所傳回目標群組相關聯的 RDS 資料庫執行個體的詳細資訊，請執行 [describe-db-proxy-targets](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-proxy-targets.html)。

## RDS API
<a name="rds-proxy-viewing.api"></a>

 若要使用 RDS API 檢視代理，請使用 [DescribeDBProxies](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBProxies.html) 操作。它會傳回 [DBProxy](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBProxy.html) 資料類型的值。

 若要查看代理的連線設定詳細資訊，請將來自此傳回值的代理識別符與 [DescribeDBProxyTargetGroups](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBProxyTargetGroups.html) 操作搭配使用。它會傳回 [DBProxyTargetGroup](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBProxyTargetGroup.html) 資料類型的值。

 若要查看與代理相關聯的 RDS 執行個體或 Aurora 資料庫叢集，請使用 [DescribeDBProxyTargets](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBProxyTargets.html) 操作。它會傳回 [DBProxyTarget](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBProxyTarget.html) 資料類型的值。