ListAccessGrantsLocationsCommand

Returns a list of the locations registered in your S3 Access Grants instance.

Permissions

You must have the s3:ListAccessGrantsLocations permission to use this operation.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { S3ControlClient, ListAccessGrantsLocationsCommand } from "@aws-sdk/client-s3-control"; // ES Modules import
// const { S3ControlClient, ListAccessGrantsLocationsCommand } = require("@aws-sdk/client-s3-control"); // CommonJS import
const client = new S3ControlClient(config);
const input = { // ListAccessGrantsLocationsRequest
  AccountId: "STRING_VALUE",
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
  LocationScope: "STRING_VALUE",
};
const command = new ListAccessGrantsLocationsCommand(input);
const response = await client.send(command);
// { // ListAccessGrantsLocationsResult
//   NextToken: "STRING_VALUE",
//   AccessGrantsLocationsList: [ // AccessGrantsLocationsList
//     { // ListAccessGrantsLocationsEntry
//       CreatedAt: new Date("TIMESTAMP"),
//       AccessGrantsLocationId: "STRING_VALUE",
//       AccessGrantsLocationArn: "STRING_VALUE",
//       LocationScope: "STRING_VALUE",
//       IAMRoleArn: "STRING_VALUE",
//     },
//   ],
// };

ListAccessGrantsLocationsCommand Input

Parameter
Type
Description
AccountId
string | undefined

The Amazon Web Services account ID of the S3 Access Grants instance.

LocationScope
string | undefined

The S3 path to the location that you are registering. The location scope can be the default S3 location s3://, the S3 path to a bucket s3://, or the S3 path to a bucket and prefix s3:///. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the engineering/ prefix or object key names that start with the marketing/campaigns/ prefix.

MaxResults
number | undefined

The maximum number of access grants that you would like returned in the List Access Grants response. If the results include the pagination token NextToken, make another call using the NextToken to determine if there are more results.

NextToken
string | undefined

A pagination token to request the next page of results. Pass this value into a subsequent List Access Grants Locations request in order to retrieve the next page of results.

ListAccessGrantsLocationsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
AccessGrantsLocationsList
ListAccessGrantsLocationsEntry[] | undefined

A container for a list of registered locations in an S3 Access Grants instance.

NextToken
string | undefined

A pagination token to request the next page of results. Pass this value into a subsequent List Access Grants Locations request in order to retrieve the next page of results.

Throws

Name
Fault
Details
S3ControlServiceException
Base exception class for all service exceptions from S3Control service.