

# 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>

AWS マネジメントコンソール から ARN を取得するには、ARN を取得したいリソースに移動し、リソースの詳細を表示します。

例えば、DB クラスターの詳細の **[設定]** タブから、DB クラスターの ARN を取得できます。

![DB クラスターの ARN。](http://docs.aws.amazon.com/ja_jp/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 コマンドで DB インスタンスの 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 | 