ListAccessGrants
Returns the list of access grants in your S3 Access Grants instance.
- Permissions
-
You must have the
s3:ListAccessGrantspermission to use this operation.
Request Syntax
GET /v20180820/accessgrantsinstance/grants?application_arn=ApplicationArn&granteeidentifier=GranteeIdentifier&granteetype=GranteeType&grantscope=GrantScope&maxResults=MaxResults&nextToken=NextToken&permission=Permission HTTP/1.1
Host: s3-control.amazonaws.com
x-amz-account-id: AccountId
URI Request Parameters
The request uses the following URI parameters.
- application_arn
-
The Amazon Resource Name (ARN) of an AWS IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application.
Grants with an application ARN match only users who sign in through an IAM Identity Center instance that uses the legacy experience, not the simplified experience for trusted identity propagation.
Length Constraints: Minimum length of 10. Maximum length of 1224.
Pattern:
arn:[^:]+:sso::\d{12}:application/.*$ - granteeidentifier
-
The unique identifier of the
Grantee. The format depends on the grantee type:-
IAM- The IAM Amazon Resource Name (ARN) of the user or role. -
DIRECTORY_USER- The user's name, or the ID that IAM Identity Center uses for the user, for example,a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. For IAM federation, the name is the subject that IAM sets from your identity provider token, for example, the user ID00u1a2b3c4EXAMPLE. For IAM Identity Center, the name is the user's username. -
DIRECTORY_GROUP- The group's display name in IAM Identity Center, for example,finance-analysts, or the group's IAM Identity Center ID. -
ATTRIBUTE- One runtime claim and its value, in the formaws:TransactionContext/IdentityProvider/key=value, for example,aws:TransactionContext/IdentityProvider/department=Finance. Each attribute grant contains one key and one value.
S3 Access Grants stores the identifier exactly as you enter it. It compares identifiers exactly, and the comparison is case sensitive. S3 Access Grants doesn't check that the user, group, or attribute exists when you create the grant.
User names can be up to 128 characters long. They can contain letters, numbers, spaces, and the characters
_ . : / = + - @. Group names can be up to 128 characters long. They can contain any character that IAM Identity Center allows in a group display name, such asR&DorFinance (EU). Attribute keys and values can each be up to 128 characters long. Both can contain letters, numbers, and the characters_ . : / + - @. Values can also contain spaces and=. As a best practice, use an immutable user ID from your identity provider instead of an email address.The filter matches the identifier stored in the grant. A grant for a user's name and a grant for the same user's IAM Identity Center user ID are separate grants.
-
- granteetype
-
The type of the grantee to which access has been granted. It can be one of the following values:
-
IAM- An IAM user or role. -
DIRECTORY_USER- A user from your corporate directory. The user can sign in through IAM Identity Center or through IAM federation with your external identity provider. -
DIRECTORY_GROUP- A group from your corporate directory. Group grants match users who sign in through IAM Identity Center. They also match users who sign in through IAM federation when the IAM identity provider is configured for group-based access. -
ATTRIBUTE- A runtime claim that you map on your IAM identity provider, such as a department. The grant matches every user who signs in through IAM federation with this runtime claim and value.
Valid Values:
DIRECTORY_USER | DIRECTORY_GROUP | IAM | ATTRIBUTE -
- grantscope
-
The S3 path of the data to which you are granting access. It is the result of appending the
Subprefixto the location scope.Length Constraints: Minimum length of 1. Maximum length of 2000.
Pattern:
^.+$ - maxResults
-
The maximum number of access grants that you would like returned in the
List Access Grantsresponse. If the results include the pagination tokenNextToken, make another call using theNextTokento determine if there are more results.Valid Range: Minimum value of 0. Maximum value of 1000.
- nextToken
-
A pagination token to request the next page of results. Pass this value into a subsequent
List Access Grantsrequest in order to retrieve the next page of results. - permission
-
The type of permission granted to your S3 data, which can be set to one of the following values:
-
READ– Grant read-only access to the S3 data. -
WRITE– Grant write-only access to the S3 data. -
READWRITE– Grant both read and write access to the S3 data.
Valid Values:
READ | WRITE | READWRITE -
- x-amz-account-id
-
The AWS account ID of the S3 Access Grants instance.
Length Constraints: Maximum length of 64.
Pattern:
^\d{12}$Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<ListAccessGrantsResult>
<NextToken>string</NextToken>
<AccessGrantsList>
<AccessGrant>
<AccessGrantArn>string</AccessGrantArn>
<AccessGrantId>string</AccessGrantId>
<AccessGrantsLocationConfiguration>
<S3SubPrefix>string</S3SubPrefix>
</AccessGrantsLocationConfiguration>
<AccessGrantsLocationId>string</AccessGrantsLocationId>
<ApplicationArn>string</ApplicationArn>
<CreatedAt>timestamp</CreatedAt>
<Grantee>
<GranteeIdentifier>string</GranteeIdentifier>
<GranteeType>string</GranteeType>
</Grantee>
<GrantScope>string</GrantScope>
<Permission>string</Permission>
</AccessGrant>
</AccessGrantsList>
</ListAccessGrantsResult>
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in XML format by the service.
- ListAccessGrantsResult
-
Root level tag for the ListAccessGrantsResult parameters.
Required: Yes
- AccessGrantsList
-
A container for a list of grants in an S3 Access Grants instance.
Type: Array of ListAccessGrantEntry data types
- NextToken
-
A pagination token to request the next page of results. Pass this value into a subsequent
List Access Grantsrequest in order to retrieve the next page of results.Type: String
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: