本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 Amazon Neptune 中使用管理 ARN
在 Amazon Web Services 中建立的資源,都是用 Amazon Resource Name (ARN) 做為唯一識別符。對於特定 Amazon Neptune 操作,您必須指定 ARN 以唯一識別 Neptune 資源。
重要
建構 Neptune 的 ARN
您可以使用下列語法,建構 Amazon Neptune 資源的 ARN。請注意,Neptune 共用 Amazon RDS ARN 的格式。
arn:aws:rds:
<region>
:<account number>
:<resourcetype>
:<name>
下表顯示您在為特定 Neptune 管理資源類型建構 ARN 時應使用的格式。
資源類型 | ARN 格式 |
---|---|
資料庫執行個體 |
arn:aws:rds: 例如:
|
資料庫叢集 |
arn:aws:rds: 例如:
|
事件訂閱 |
arn:aws:rds: 例如:
|
DB parameter group (資料庫參數群組) |
arn:aws:rds: 例如:
|
DB cluster parameter group (資料庫叢集參數群組) |
arn:aws:rds: 例如:
|
資料庫叢集快照 |
arn:aws: 例如:
|
資料庫子網路群組 |
arn:aws: 例如:
|
在 Amazon Neptune 中取得現有的 ARN
您可以使用 AWS Management Console、 AWS Command Line Interface (AWS CLI) 或 Neptune API 來取得 Neptune 資源的 ARN。
使用取得現有的 ARN AWS Management Console
若要使用主控台取得 ARN,請瀏覽至您需要 ARN 的資源,然後檢視該資源的詳細資訊。例如,若要取得資料庫執行個體的 ARN,請選擇導覽面板中的 Instances (執行個體),然後從清單中選擇所要的執行個體。ARN 位在 Instance Details (執行個體詳細資訊) 部分。
使用取得現有的 ARN AWS CLI
若要使用取 AWS CLI 得特定 Neptune 資源的 ARN,請使用該資源的describe
命令。下表顯示每個 AWS CLI 命令和 ARN 屬性,這些屬性與命令搭配使用以取得 ARN。
AWS CLI 命令 | ARN 屬性 |
---|---|
describe-event-subscriptions | EventSubscription阿恩 |
describe-certificates | CertificateArn |
describe-db-parameter-groups | DB ParameterGroup 阿恩 |
describe-db-cluster-parameter-groups | 資料庫 ClusterParameter GroupArn |
describe-db-instances | 資料庫 InstanceArn |
describe-events | SourceArn |
describe-db-subnet-groups | DB SubnetGroup 阿恩 |
describe-db-clusters | 資料庫 ClusterArn |
describe-db-cluster-snapshots | DB ClusterSnapshot 阿恩 |
例如,下列 AWS CLI 命令會取得資料庫執行個體的 ARN。
範例
對於 Linux、OS X 或 Unix:
aws neptune describe-db-instances \ --db-instance-identifier
DBInstanceIdentifier
\ --regionus-west-2
針對 Windows:
aws neptune describe-db-instances ^ --db-instance-identifier
DBInstanceIdentifier
^ --regionus-west-2
使用 API 取得現有 ARN
若要取得特定 Neptune 資源的 ARN,請呼叫以下 API 動作,並使用如下所示的 ARN 屬性。
Neptune API 動作 | ARN 屬性 |
---|---|
DescribeEvent訂閱 | EventSubscription阿恩 |
DescribeCertificates | CertificateArn |
描述 B ParameterGroups | DB ParameterGroup 阿恩 |
描述 B 群組 ClusterParameter | 資料庫 ClusterParameter GroupArn |
DescribeDBInstances | 資料庫 InstanceArn |
DescribeEvents | SourceArn |
描述 B SubnetGroups | DB SubnetGroup 阿恩 |
DescribeDBClusters | 資料庫 ClusterArn |
描述 B ClusterSnapshots | DB ClusterSnapshot 阿恩 |