2026/11/29 - AWS S3 Control - 4 updated api methods
Changes Added S3 API GetPart allowing users to retrieve individual parts of in-progress and complete multipart uploads. Also introduced bucket default storage classes for users to change bucket default to intelligent tiering, and apply to all new objects stored in the bucket.
{'Grantee': {'GranteeType': {'ATTRIBUTE'}}}
Creates an access grant that gives a grantee access to your S3 data. The grantee can be an IAM user or role, a directory user or group, or an attribute. Before you can create a grant, you must have an S3 Access Grants instance in the same Region as the S3 data. You can create an S3 Access Grants instance using the CreateAccessGrantsInstance. You must also have registered at least one S3 data location in your S3 Access Grants instance using CreateAccessGrantsLocation.
Permissions
You must have the s3:CreateAccessGrant permission to use this operation.
Additional Permissions
To create a grant with an ApplicationArn, you must also have the sso:DescribeInstance permission. Other grants don't require additional permissions.
See also: AWS API Documentation
Request Syntax
client.create_access_grant(
AccountId='string',
AccessGrantsLocationId='string',
AccessGrantsLocationConfiguration={
'S3SubPrefix': 'string'
},
Grantee={
'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM'|'ATTRIBUTE',
'GranteeIdentifier': 'string'
},
Permission='READ'|'WRITE'|'READWRITE',
ApplicationArn='string',
S3PrefixType='Object',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
string
[REQUIRED]
The Amazon Web Services account ID of the S3 Access Grants instance.
string
[REQUIRED]
The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID default to the default location s3:// and assigns an auto-generated ID to other locations that you register.
If you are passing the default location, you cannot create an access grant for the entire default location. You must also specify a bucket or a bucket and prefix in the Subprefix field.
dict
The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access. It contains the S3SubPrefix field. The grant scope is the result of appending the subprefix to the location scope of the registered location.
S3SubPrefix (string) --
The S3SubPrefix is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location s3:// because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location s3://, the S3SubPrefx can be a <bucket-name>/*, so the full grant scope path would be s3://<bucket-name>/*. Or the S3SubPrefx can be <bucket-name>/<prefix-name>*, so the full grant scope path would be or s3://<bucket-name>/<prefix-name>*.
If the S3SubPrefix includes a prefix, append the wildcard character * after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix.
dict
[REQUIRED]
The user, group, role, or attribute to which you are granting access. The grantee can be an IAM user or role, a directory user or group, or an attribute. A directory user or group comes from your corporate directory. Your users can sign in through IAM Identity Center or through IAM federation with trusted identity propagation (TIP). IAM Identity Center instances use the legacy experience until you turn on the simplified experience for trusted identity propagation. If your instance uses the legacy experience, associate it with your S3 Access Grants instance.
GranteeType (string) --
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.
GranteeIdentifier (string) --
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 ID 00u1a2b3c4EXAMPLE. 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 form aws: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 as R&D or Finance (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.
string
[REQUIRED]
The type of access that you are granting 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.
string
The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If you include an application ARN in the request, the grantee can access the S3 data only through this application. This is an application-scoped grant. You can create one only for a directory user or group. Your S3 Access Grants instance must also be associated with an IAM Identity Center instance that uses the legacy experience, not the simplified experience for trusted identity propagation. Otherwise, the request fails with an InvalidRequest error.
string
The type of S3SubPrefix. The only possible value is Object. Pass this value if the access grant scope is an object. Do not pass this value if the access grant scope is a bucket or a bucket and a prefix.
list
The Amazon Web Services resource tags that you are adding to the access grant. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.
(dict) --
A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources.
Key (string) -- [REQUIRED]
The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with aws: aren’t supported.
Value (string) -- [REQUIRED]
The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive.
dict
Response Syntax
{
'CreatedAt': datetime(2015, 1, 1),
'AccessGrantId': 'string',
'AccessGrantArn': 'string',
'Grantee': {
'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM'|'ATTRIBUTE',
'GranteeIdentifier': 'string'
},
'AccessGrantsLocationId': 'string',
'AccessGrantsLocationConfiguration': {
'S3SubPrefix': 'string'
},
'Permission': 'READ'|'WRITE'|'READWRITE',
'ApplicationArn': 'string',
'GrantScope': 'string'
}
Response Structure
(dict) --
CreatedAt (datetime) --
The date and time when you created the access grant.
AccessGrantId (string) --
The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
AccessGrantArn (string) --
The Amazon Resource Name (ARN) of the access grant.
Grantee (dict) --
The user, group, role, or attribute to which you are granting access. The grantee can be an IAM user or role, a directory user or group, or an attribute. A directory user or group comes from your corporate directory. Your users can sign in through IAM Identity Center or through IAM federation with trusted identity propagation (TIP). IAM Identity Center instances use the legacy experience until you turn on the simplified experience for trusted identity propagation. If your instance uses the legacy experience, associate it with your S3 Access Grants instance.
GranteeType (string) --
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.
GranteeIdentifier (string) --
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 ID 00u1a2b3c4EXAMPLE. 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 form aws: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 as R&D or Finance (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.
AccessGrantsLocationId (string) --
The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID default to the default location s3:// and assigns an auto-generated ID to other locations that you register.
AccessGrantsLocationConfiguration (dict) --
The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.
S3SubPrefix (string) --
The S3SubPrefix is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location s3:// because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location s3://, the S3SubPrefx can be a <bucket-name>/*, so the full grant scope path would be s3://<bucket-name>/*. Or the S3SubPrefx can be <bucket-name>/<prefix-name>*, so the full grant scope path would be or s3://<bucket-name>/<prefix-name>*.
If the S3SubPrefix includes a prefix, append the wildcard character * after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix.
Permission (string) --
The type of access that you are granting 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.
ApplicationArn (string) --
The Amazon Resource Name (ARN) of an Amazon Web Services 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.
GrantScope (string) --
The S3 path of the data to which you are granting access. It is the result of appending the Subprefix to the location scope.
{'Grantee': {'GranteeType': {'ATTRIBUTE'}}}
Get the details of an access grant from your S3 Access Grants instance.
Permissions
You must have the s3:GetAccessGrant permission to use this operation.
See also: AWS API Documentation
Request Syntax
client.get_access_grant(
AccountId='string',
AccessGrantId='string'
)
string
[REQUIRED]
The Amazon Web Services account ID of the S3 Access Grants instance.
string
[REQUIRED]
The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
dict
Response Syntax
{
'CreatedAt': datetime(2015, 1, 1),
'AccessGrantId': 'string',
'AccessGrantArn': 'string',
'Grantee': {
'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM'|'ATTRIBUTE',
'GranteeIdentifier': 'string'
},
'Permission': 'READ'|'WRITE'|'READWRITE',
'AccessGrantsLocationId': 'string',
'AccessGrantsLocationConfiguration': {
'S3SubPrefix': 'string'
},
'GrantScope': 'string',
'ApplicationArn': 'string'
}
Response Structure
(dict) --
CreatedAt (datetime) --
The date and time when you created the access grant.
AccessGrantId (string) --
The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
AccessGrantArn (string) --
The Amazon Resource Name (ARN) of the access grant.
Grantee (dict) --
The user, group, role, or attribute to which you are granting access. The grantee can be an IAM user or role, a directory user or group, or an attribute. A directory user or group comes from your corporate directory. Your users can sign in through IAM Identity Center or through IAM federation with trusted identity propagation (TIP). IAM Identity Center instances use the legacy experience until you turn on the simplified experience for trusted identity propagation. If your instance uses the legacy experience, associate it with your S3 Access Grants instance.
GranteeType (string) --
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.
GranteeIdentifier (string) --
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 ID 00u1a2b3c4EXAMPLE. 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 form aws: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 as R&D or Finance (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.
Permission (string) --
The type of permission that was granted in the access grant. Can be 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.
AccessGrantsLocationId (string) --
The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID default to the default location s3:// and assigns an auto-generated ID to other locations that you register.
AccessGrantsLocationConfiguration (dict) --
The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.
S3SubPrefix (string) --
The S3SubPrefix is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location s3:// because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location s3://, the S3SubPrefx can be a <bucket-name>/*, so the full grant scope path would be s3://<bucket-name>/*. Or the S3SubPrefx can be <bucket-name>/<prefix-name>*, so the full grant scope path would be or s3://<bucket-name>/<prefix-name>*.
If the S3SubPrefix includes a prefix, append the wildcard character * after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix.
GrantScope (string) --
The S3 path of the data to which you are granting access. It is the result of appending the Subprefix to the location scope.
ApplicationArn (string) --
The Amazon Resource Name (ARN) of an Amazon Web Services 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.
{'Grantee': {'GranteeType': {'ATTRIBUTE'}}}
Returns a temporary access credential from S3 Access Grants to the grantee or client application. The temporary credential is an Amazon Web Services STS token that grants them access to the S3 data. By default, S3 Access Grants searches for a matching grant in the instance of the Amazon Web Services account ID in the request. To also search instances shared with the caller through Amazon Web Services Resource Access Manager (RAM), set the InstanceScope parameter to ALL.
S3 Access Grants considers every identity in a request when it matches grants. It matches grants for the IAM role used for the session, the directory user, and the user's groups. For users who sign in through IAM federation, it also matches grants for the user's attributes. A user's grants can use the user's name or IAM Identity Center ID, and S3 Access Grants matches both. A group's grants can use the group's display name or ID, and S3 Access Grants matches both. Group grants and grants that use an IAM Identity Center ID match federated users only when your IAM identity provider is configured for group-based access.
If more than one grant matches, S3 Access Grants returns credentials for the grant whose location most closely matches the requested target. If two grants match the target equally closely, a user grant takes priority over a group grant. A group grant takes priority over an attribute grant, and an attribute grant over an IAM grant.
In some cases, S3 Access Grants looks up the user in IAM Identity Center. This happens when your IAM identity provider is configured for group-based access, or when your IAM Identity Center instance uses the simplified experience. If S3 Access Grants can't find the user, it denies the request. No grant applies, including grants for the IAM role. Each user needs an IAM Identity Center username that matches their subject.
Permissions
You must have the s3:GetDataAccess permission to use this operation.
Additional Permissions
The IAM role that S3 Access Grants assumes must have the following permissions specified in the trust policy when registering the location: sts:AssumeRole, for directory users or groups sts:SetContext, and for IAM users or roles sts:SetSourceIdentity.
See also: AWS API Documentation
Request Syntax
client.get_data_access(
AccountId='string',
Target='string',
Permission='READ'|'WRITE'|'READWRITE',
DurationSeconds=123,
Privilege='Minimal'|'Default',
TargetType='Object',
AuditContext='string',
InstanceScope='SELF'|'ALL'
)
string
[REQUIRED]
The Amazon Web Services account ID of the S3 Access Grants instance.
string
[REQUIRED]
The S3 URI path of the data to which you are requesting temporary access credentials. If the requesting account has an access grant for this data, S3 Access Grants vends temporary access credentials in the response.
string
[REQUIRED]
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.
integer
The session duration, in seconds, of the temporary access credential that S3 Access Grants vends to the grantee or client application. The default value is 1 hour, but the grantee can specify a range from 900 seconds (15 minutes) up to 43200 seconds (12 hours). If the grantee requests a value higher than this maximum, the operation fails.
string
The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.
Default – The scope of the returned temporary access token is the scope of the grant that is closest to the target scope.
Minimal – The scope of the returned temporary access token is the same as the requested target scope as long as the requested scope is the same as or a subset of the grant scope.
string
The type of Target. The only possible value is Object. Pass this value if the target data that you would like to access is a path to an object. Do not pass this value if the target data is a bucket or a bucket and a prefix.
string
The context to identify the job or query associated with the credential request. This information will be displayed in CloudTrail log in your account.
string
The scope of S3 Access Grants instances to search for a grant matching the requested S3 URI path.
SELF – Searches only the instance of the Amazon Web Services account ID in the request.
ALL – Searches the instance of the Amazon Web Services account ID in the request and all instances shared with the caller's account through Amazon Web Services Resource Access Manager (RAM).
dict
Response Syntax
{
'Credentials': {
'AccessKeyId': 'string',
'SecretAccessKey': 'string',
'SessionToken': 'string',
'Expiration': datetime(2015, 1, 1)
},
'MatchedGrantTarget': 'string',
'Grantee': {
'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM'|'ATTRIBUTE',
'GranteeIdentifier': 'string'
},
'MatchedInstanceArn': 'string'
}
Response Structure
(dict) --
Credentials (dict) --
The temporary credential token that S3 Access Grants vends.
AccessKeyId (string) --
The unique access key ID of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.
SecretAccessKey (string) --
The secret access key of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.
SessionToken (string) --
The Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications.
Expiration (datetime) --
The expiration date and time of the temporary credential that S3 Access Grants vends to grantees and client applications.
MatchedGrantTarget (string) --
The S3 URI path of the data to which you are being granted temporary access credentials.
Grantee (dict) --
The user, group, role, or attribute that you granted access to the S3 location scope. For directory identities, this API also returns the grants of the IAM role used for the identity-aware request. For more information on identity-aware sessions, see Granting permissions to use identity-aware console sessions.
GranteeType (string) --
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.
GranteeIdentifier (string) --
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 ID 00u1a2b3c4EXAMPLE. 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 form aws: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 as R&D or Finance (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.
MatchedInstanceArn (string) --
The Amazon Resource Name (ARN) of the S3 Access Grants instance containing the grant that matched the requested S3 URI path.
{'GranteeType': {'ATTRIBUTE'}}
Response {'AccessGrantsList': {'Grantee': {'GranteeType': {'ATTRIBUTE'}}}}
Returns the list of access grants in your S3 Access Grants instance.
Permissions
You must have the s3:ListAccessGrants permission to use this operation.
See also: AWS API Documentation
Request Syntax
client.list_access_grants(
AccountId='string',
NextToken='string',
MaxResults=123,
GranteeType='DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM'|'ATTRIBUTE',
GranteeIdentifier='string',
Permission='READ'|'WRITE'|'READWRITE',
GrantScope='string',
ApplicationArn='string'
)
string
[REQUIRED]
The Amazon Web Services account ID of the S3 Access Grants instance.
string
A pagination token to request the next page of results. Pass this value into a subsequent List Access Grants request in order to retrieve the next page of results.
integer
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.
string
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.
string
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 ID 00u1a2b3c4EXAMPLE. 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 form aws: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 as R&D or Finance (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.
string
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.
string
The S3 path of the data to which you are granting access. It is the result of appending the Subprefix to the location scope.
string
The Amazon Resource Name (ARN) of an Amazon Web Services 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.
dict
Response Syntax
{
'NextToken': 'string',
'AccessGrantsList': [
{
'CreatedAt': datetime(2015, 1, 1),
'AccessGrantId': 'string',
'AccessGrantArn': 'string',
'Grantee': {
'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM'|'ATTRIBUTE',
'GranteeIdentifier': 'string'
},
'Permission': 'READ'|'WRITE'|'READWRITE',
'AccessGrantsLocationId': 'string',
'AccessGrantsLocationConfiguration': {
'S3SubPrefix': 'string'
},
'GrantScope': 'string',
'ApplicationArn': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
A pagination token to request the next page of results. Pass this value into a subsequent List Access Grants request in order to retrieve the next page of results.
AccessGrantsList (list) --
A container for a list of grants in an S3 Access Grants instance.
(dict) --
Information about the access grant.
CreatedAt (datetime) --
The date and time when you created the S3 Access Grants instance.
AccessGrantId (string) --
The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
AccessGrantArn (string) --
The Amazon Resource Name (ARN) of the access grant.
Grantee (dict) --
The user, group, role, or attribute to which you are granting access. The grantee can be an IAM user or role, a directory user or group, or an attribute. A directory user or group comes from your corporate directory. Your users can sign in through IAM Identity Center or through IAM federation with trusted identity propagation (TIP). IAM Identity Center instances use the legacy experience until you turn on the simplified experience for trusted identity propagation. If your instance uses the legacy experience, associate it with your S3 Access Grants instance.
GranteeType (string) --
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.
GranteeIdentifier (string) --
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 ID 00u1a2b3c4EXAMPLE. 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 form aws: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 as R&D or Finance (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.
Permission (string) --
The type of access 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.
AccessGrantsLocationId (string) --
The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID default to the default location s3:// and assigns an auto-generated ID to other locations that you register.
AccessGrantsLocationConfiguration (dict) --
The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.
S3SubPrefix (string) --
The S3SubPrefix is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location s3:// because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location s3://, the S3SubPrefx can be a <bucket-name>/*, so the full grant scope path would be s3://<bucket-name>/*. Or the S3SubPrefx can be <bucket-name>/<prefix-name>*, so the full grant scope path would be or s3://<bucket-name>/<prefix-name>*.
If the S3SubPrefix includes a prefix, append the wildcard character * after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix.
GrantScope (string) --
The S3 path of the data to which you are granting access. It is the result of appending the Subprefix to the location scope.
ApplicationArn (string) --
The Amazon Resource Name (ARN) of an Amazon Web Services 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.