

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

# 取得 Amazon RDS 的現有 ARN
<a name="USER_Tagging.ARN.Getting"></a>

您可以使用 AWS 管理主控台、 AWS Command Line Interface (AWS CLI) 或 RDS API 來取得 RDS 資源的 ARN。

## 主控台
<a name="USER_Tagging.ARN.CON"></a>

若要從 取得 ARN AWS 管理主控台，請導覽至您想要 ARN 的資源，並檢視該資源的詳細資訊。

例如，您可以從資料庫叢集詳細資訊的**組態**標籤中取得資料庫叢集的 ARN。

![資料庫叢集 ARN。](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/AuroraUserGuide/images/DB-cluster-arn.png)


## AWS CLI
<a name="USER_Tagging.ARN.CLI"></a>

若要從特定 RDS 資源 AWS CLI 的 取得 ARN，您可以使用該資源的 `describe`命令。下表顯示每個 AWS CLI 命令，以及與命令搭配使用以取得 ARN 的 ARN 屬性。


****  

| AWS CLI 命令 | ARN 屬性 | 
| --- | --- | 
|  [describe-event-subscriptions](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-event-subscriptions.html)  | EventSubscriptionArn | 
|  [describe-certificates](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-certificates.html) | CertificateArn | 
|  [describe-db-parameter-groups](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameter-groups.html) | DBParameterGroupArn | 
|  [describe-db-cluster-parameter-groups](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameter-groups.html) | DBClusterParameterGroupArn | 
|  [describe-db-instances](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-instances.html) | DBInstanceArn | 
|  [describe-db-security-groups](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-security-groups.html) | DBSecurityGroupArn | 
|  [describe-db-snapshots](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-snapshots.html) | DBSnapshotArn | 
|  [describe-events](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-events.html) | SourceArn | 
|  [describe-reserved-db-instances](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-reserved-db-instances.html) | ReservedDBInstanceArn | 
|  [describe-db-subnet-groups](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-subnet-groups.html) | DBSubnetGroupArn | 
|  [describe-db-clusters](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-clusters.html) | DBClusterArn | 
|  [describe-db-cluster-snapshots](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-snapshots.html) | DBClusterSnapshotArn | 

例如，下列 AWS CLI 命令會取得資料庫執行個體的 ARN。

**Example**  
針對 Linux、macOS 或 Unix：  

```
aws rds describe-db-instances \
--db-instance-identifier {{DBInstanceIdentifier}} \
--region {{us-west-2}} \
--query "*[].{DBInstanceIdentifier:DBInstanceIdentifier,DBInstanceArn:DBInstanceArn}"
```
在 Windows 中：  

```
aws rds describe-db-instances ^
--db-instance-identifier {{DBInstanceIdentifier}} ^
--region {{us-west-2}} ^
--query "*[].{DBInstanceIdentifier:DBInstanceIdentifier,DBInstanceArn:DBInstanceArn}"
```
該命令的輸出與以下內容相似：  

```
[
    {
        "DBInstanceArn": "arn:aws:rds:us-west-2:{{account_id}}:db:{{instance_id}}", 
        "DBInstanceIdentifier": "{{instance_id}}"
    }
]
```

## RDS API
<a name="USER_Tagging.ARN.API"></a>

若要取得特定 RDS 資源的 ARN，則可呼叫下列 RDS API 操作，並搭配使用下方所示的 ARN 屬性。


****  

| RDS API 操作 | ARN 屬性 | 
| --- | --- | 
|  [DescribeEventSubscriptions](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeEventSubscriptions.html) | EventSubscriptionArn | 
|  [DescribeCertificates](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeCertificates.html) | CertificateArn | 
|  [DescribeDBParameterGroups](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBParameterGroups.html) | DBParameterGroupArn | 
|  [DescribeDBClusterParameterGroups](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBClusterParameterGroups.html) | DBClusterParameterGroupArn | 
|  [DescribeDBInstances](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBInstances.html) | DBInstanceArn | 
|  [DescribeDBSecurityGroups](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBSecurityGroups.html) | DBSecurityGroupArn | 
|  [DescribeDBSnapshots](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBSnapshots.html) | DBSnapshotArn | 
|  [DescribeEvents](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeEvents.html) | SourceArn | 
|  [DescribeReservedDBInstances](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeReservedDBInstances.html) | ReservedDBInstanceArn | 
|  [DescribeDBSubnetGroups](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBSubnetGroups.html) | DBSubnetGroupArn | 
|  [DescribeDBClusters](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBClusters.html) | DBClusterArn | 
|  [DescribeDBClusterSnapshots](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBClusterSnapshots.html) | DBClusterSnapshotArn | 