Lihat detail lokasi yang terdaftar - Amazon Simple Storage Service

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Lihat detail lokasi yang terdaftar

Anda bisa mendapatkan detail lokasi yang terdaftar di instans S3 Access Grants dengan menggunakan konsol Amazon S3, AWS Command Line Interface (AWS CLI), Amazon S3 RESTAPI, dan AWS SDKs.

Untuk melihat lokasi yang terdaftar di instans S3 Access Grants
  1. Masuk ke AWS Management Console dan buka konsol Amazon S3 di. https://console.aws.amazon.com/s3/

  2. Pada panel navigasi di sebelah kiri, pilih Access Grants.

  3. Pada halaman S3 Access Grants, pilih Region yang berisi instance S3 Access Grants yang ingin Anda gunakan.

  4. Pilih Lihat detail untuk contoh.

  5. Pada halaman detail untuk contoh, pilih tab Lokasi.

  6. Temukan lokasi terdaftar yang ingin Anda lihat. Untuk memfilter daftar lokasi terdaftar, gunakan kotak pencarian.

Untuk menginstal AWS CLI, lihat Memasang AWS CLIdi AWS Command Line Interface Panduan Pengguna.

Untuk menggunakan perintah contoh berikut, ganti user input placeholders dengan informasi Anda sendiri.

contoh — Dapatkan detail lokasi yang terdaftar
aws s3control get-access-grants-location \ --account-id 111122223333 \ --access-grants-location-id default

Respons:

{ "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" }
contoh — Daftar semua lokasi yang terdaftar dalam instance S3 Access Grants

Untuk membatasi hasil ke awalan atau bucket S3, Anda dapat menggunakan parameter secara opsional. --location-scope s3://bucket-and-or-prefix

aws s3control list-access-grants-locations \ --account-id 111122223333 \ --region us-east-2

Respons:

{"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" } ] }

Untuk informasi tentang REST API dukungan Amazon S3 untuk mendapatkan detail lokasi terdaftar atau mencantumkan semua lokasi yang terdaftar dengan instans S3 Access Grants, lihat bagian berikut di Referensi Layanan Penyimpanan Sederhana Amazon: API

Bagian ini memberikan contoh cara mendapatkan rincian lokasi terdaftar atau daftar semua lokasi terdaftar dalam instance S3 Access Grants dengan menggunakan AWS SDKs.

Untuk menggunakan contoh berikut, ganti user input placeholders dengan informasi Anda sendiri.

Java
contoh — Dapatkan detail lokasi yang terdaftar
public void getAccessGrantsLocation() { GetAccessGrantsLocationRequest getAccessGrantsLocationRequest = GetAccessGrantsLocationRequest.builder() .accountId("111122223333") .accessGrantsLocationId("default") .build(); GetAccessGrantsLocationResponse getAccessGrantsLocationResponse = s3Control.getAccessGrantsLocation(getAccessGrantsLocationRequest); LOGGER.info("GetAccessGrantsLocationResponse: " + getAccessGrantsLocationResponse); }

Respons:

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 )
contoh — Daftar semua lokasi terdaftar dalam instance S3 Access Grants

Untuk membatasi hasil ke awalan atau bucket S3, Anda dapat meneruskan S3 secara opsionalURI, sepertis3://bucket-and-or-prefix, dalam parameter. LocationScope

public void listAccessGrantsLocations() { ListAccessGrantsLocationsRequest listRequest = ListAccessGrantsLocationsRequest.builder() .accountId("111122223333") .build(); ListAccessGrantsLocationsResponse listResponse = s3Control.listAccessGrantsLocations(listRequest); LOGGER.info("ListAccessGrantsLocationsResponse: " + listResponse); }

Respons:

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 ) ] )