

# 登録済みロケーションの詳細を表示する
<a name="access-grants-location-view"></a>

Amazon S3 コンソール、AWS Command Line Interface (AWS CLI)、Amazon S3 REST API、AWS SDK を使用して、S3 Access Grants インスタンスに登録されているロケーションの詳細を取得できます。

## S3 コンソールの使用
<a name="access-grants-location-edit-console"></a>

**S3 Access Grants インスタンスに登録済みのロケーションを表示するには**

1. AWS マネジメントコンソール にサインインし、Amazon S3 コンソール [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/) を開きます。

1. 左側のナビゲーションペインで、**[Access Grants]** を選択します。

1. **[S3 Access Grants]** ページで、取り組む S3 Access Grants インスタンスが含まれるリージョンを選択します。

1. インスタンスの **[詳細の表示]** をクリックします。

1. インスタンスの詳細ページで、**[ロケーション]** タブをクリックします。

1. 確認する登録済みのロケーションを検索します。登録済みロケーションの一覧にフィルターを適用するには、検索ボックスを使用します。

## の使用AWS CLI
<a name="access-grants-location-edit-cli"></a>

AWS CLI をインストールするには、**「AWS Command Line Interface ユーザーガイド」の「[AWS CLI をインストールする](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)」を参照してください。

次のコマンド例を使用するには、`{{user input placeholders}}` をユーザー自身の情報に置き換えます。

**Example – 登録済みロケーションの詳細を取得する**  

```
aws s3control get-access-grants-location \
--account-id {{111122223333}} \
--access-grants-location-id {{default}}
```
レスポンス:  

```
{
    "CreatedAt": "{{2023-05-31T18:23:48.107000+00:00}}",
    "AccessGrantsLocationId": "{{default}}",
    "AccessGrantsLocationArn": "arn:aws:s3:{{us-east-2}}:{{111122223333}}:access-grants/default/location/{{default}}",
    "IAMRoleArn": "arn:aws:iam::{{111122223333}}:role/{{accessGrantsTestRole}}"
}
```

**Example – S3 Access Grants インスタンスに登録済みのロケーションをすべて一覧表示する**  
結果を S3 プレフィックスまたはバケットで限定するには、必要に応じて `--location-scope s3://{{bucket-and-or-prefix}}` パラメータを使用できます。  

```
aws s3control list-access-grants-locations \
--account-id {{111122223333}} \
--region {{us-east-2}}
```
レスポンス:  

```
{"AccessGrantsLocationsList": [
  {
    "CreatedAt": "{{2023-05-31T18:23:48.107000+00:00}}",
    "AccessGrantsLocationId": "default",
    "AccessGrantsLocationArn": "arn:aws:s3:{{us-east-2}}:{{111122223333}}:access-grants/default/location/default",
    "LocationScope": "s3://" 
    "IAMRoleArn": "arn:aws:iam::{{111122223333}}:role/{{accessGrantsTestRole}}"
     },
  {
    "CreatedAt": "{{2023-05-31T18:23:48.107000+00:00}}",
    "AccessGrantsLocationId": "{{635f1139-1af2-4e43-8131-a4de006eb456}}",
    "AccessGrantsLocationArn": "arn:aws:s3:{{us-east-2}}:{{111122223333}}:access-grants/default/location/{{635f1139-1af2-4e43-8131-a4de006eb888}}",
    "LocationScope": "s3://{{amzn-s3-demo-bucket/prefixA*}}",
    "IAMRoleArn": "arn:aws:iam::{{111122223333}}:role/{{accessGrantsTestRole}}"
     }
   ]
  }
```

## REST API の使用
<a name="access-grants-location-edit-rest-api"></a>

Amazon S3 REST API で登録済みのロケーションの詳細を入手したり、S3 Access Grants インスタンスに登録されたロケーションのすべてを一覧表示する方法の詳細については、「**Amazon Simple Storage Service API リファレンス」の次のセクションを参照してください。
+  [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessGrantsLocation.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessGrantsLocation.html) 
+  [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessGrantsLocations.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessGrantsLocations.html) 

## AWS SDK の使用
<a name="access-grants-location-edit-using-sdk"></a>

このセクションでは、AWS SDK を使用して S3 Access Grants インスタンスに登録済みのロケーションの詳細を取得したり、すべての登録済みのロケーションを一覧表示する方法の例を説明します。

次の例を実行するには、`{{user input placeholders}}` をユーザー自身の情報に置き換えます。

------
#### [ Java ]

**Example – 登録済みロケーションの詳細を取得する**  

```
public void getAccessGrantsLocation() {
GetAccessGrantsLocationRequest getAccessGrantsLocationRequest = GetAccessGrantsLocationRequest.builder()
.accountId("{{111122223333}}")
.accessGrantsLocationId("default")
.build();
GetAccessGrantsLocationResponse getAccessGrantsLocationResponse = s3Control.getAccessGrantsLocation(getAccessGrantsLocationRequest);
LOGGER.info("GetAccessGrantsLocationResponse: " + getAccessGrantsLocationResponse);
}
```
レスポンス:  

```
GetAccessGrantsLocationResponse(
CreatedAt={{2023-06-07T04:35:10.027Z}},
AccessGrantsLocationId=default,
AccessGrantsLocationArn=arn:aws:s3:{{us-east-2}}:{{111122223333}}:access-grants/default/location/default,
LocationScope= s3://,
IAMRoleArn=arn:aws:iam::{{111122223333}}:role/{{accessGrantsTestRole}}
)
```

**Example – S3 Access Grants インスタンスに登録済みのロケーションをすべて一覧表示する**  
結果を S3 プレフィックスまたはバケットで限定するには、必要に応じて `LocationScope` パラメータで `s3://{{bucket-and-or-prefix}}` などの S3 URI を使用できます。  

```
public void listAccessGrantsLocations() {

ListAccessGrantsLocationsRequest listRequest =   ListAccessGrantsLocationsRequest.builder()
.accountId("{{111122223333}}")
.build();

ListAccessGrantsLocationsResponse listResponse = s3Control.listAccessGrantsLocations(listRequest);
LOGGER.info("ListAccessGrantsLocationsResponse: " + listResponse);
}
```
レスポンス:  

```
ListAccessGrantsLocationsResponse(
AccessGrantsLocationsList=[
ListAccessGrantsLocationsEntry(
CreatedAt={{2023-06-07T04:35:11.027Z}},
AccessGrantsLocationId=default,
AccessGrantsLocationArn=arn:aws:s3:{{us-east-2}}:{{111122223333}}:access-grants/default/location/default,
LocationScope=s3://,
IAMRoleArn=arn:aws:iam::{{111122223333}}:role/{{accessGrantsTestRole}}
),
ListAccessGrantsLocationsEntry(
CreatedAt={{2023-06-07T04:35:10.027Z}},
AccessGrantsLocationId={{635f1139-1af2-4e43-8131-a4de006eb456}},
AccessGrantsLocationArn=arn:aws:s3:{{us-east-2}}:{{111122223333}}:access-grants/default/location/{{635f1139-1af2-4e43-8131-a4de006eb888}},
LocationScope=s3://{{amzn-s3-demo-bucket/prefixA*}},
IAMRoleArn=arn:aws:iam::{{111122223333}}:role/{{accessGrantsTestRole}}
)
]
)
```

------