Skip to main content

access_grants

Creates, updates, deletes, gets or lists an access_grants resource.

Overview

Nameaccess_grants
TypeResource
Idaws.s3control.access_grants

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_grant_arnstringThe Amazon Resource Name (ARN) of the access grant.
access_grant_idstringThe ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
access_grants_location_configurationstringThe configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.
access_grants_location_idstringThe 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.
application_arnstringThe 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.
created_atstringThe date and time when you created the access grant.
grant_scopestringThe S3 path of the data to which you are granting access. It is the result of appending the Subprefix to the location scope.
granteestringThe user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.
permissionstringThe 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_access_grantselectx-amz-account-id, id, regionGet the details of an access grant from your S3 Access Grants instance. Permissions You must have the s3:GetAccessGrant permission to use this operation.
list_access_grantsselectx-amz-account-id, regionnextToken, maxResults, granteetype, granteeidentifier, permission, grantscope, application_arnReturns the list of access grants in your S3 Access Grants instance. Permissions You must have the s3:ListAccessGrants permission to use this operation.
create_access_grantinsertx-amz-account-id, region, AccessGrantsLocationIdCreates an access grant that gives a grantee access to your S3 data. The grantee can be an IAM user or role or a directory user, or group. 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 For any directory identity - sso:DescribeInstance and sso:DescribeApplication For directory users - identitystore:DescribeUser For directory groups - identitystore:DescribeGroup
associate_access_grants_identity_centerupdatex-amz-account-id, region, IdentityCenterArnAssociate your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance. Use this action if you want to create access grants for users or groups from your corporate identity directory. First, you must add your corporate identity directory to Amazon Web Services IAM Identity Center. Then, you can associate this IAM Identity Center instance with your S3 Access Grants instance. Permissions You must have the s3:AssociateAccessGrantsIdentityCenter permission to use this operation. Additional Permissions You must also have the following permissions: sso:CreateApplication, sso:PutApplicationGrant, and sso:PutApplicationAuthenticationMethod.
delete_access_grantdeletex-amz-account-id, id, regionDeletes the access grant from the S3 Access Grants instance. You cannot undo an access grant deletion and the grantee will no longer have access to the S3 data. Permissions You must have the s3:DeleteAccessGrant permission to use this operation.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
regionstringAWS region (default: us-east-1)
x-amz-account-idstringThe Amazon Web Services account ID of the S3 Access Grants instance.
application_arnstringThe 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.
granteeidentifierstringThe unique identifer of the Grantee. If the grantee type is IAM, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.
granteetypestringThe 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 - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. DIRECTORY_GROUP - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.
grantscopestringThe S3 path of the data to which you are granting access. It is the result of appending the Subprefix to the location scope.
maxResultsintegerThe 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.
nextTokenstringA 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.
permissionstringThe 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.

SELECT examples

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.

SELECT
access_grant_arn,
access_grant_id,
access_grants_location_configuration,
access_grants_location_id,
application_arn,
created_at,
grant_scope,
grantee,
permission
FROM aws.s3control.access_grants
WHERE `x-amz-account-id` = '{{ x-amz-account-id }}' -- required
AND id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an access grant that gives a grantee access to your S3 data. The grantee can be an IAM user or role or a directory user, or group. 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 For any directory identity - sso:DescribeInstance and sso:DescribeApplication For directory users - identitystore:DescribeUser For directory groups - identitystore:DescribeGroup

INSERT INTO aws.s3control.access_grants (
AccessGrantsLocationId,
AccessGrantsLocationConfiguration,
Grantee,
Permission,
ApplicationArn,
S3PrefixType,
Tags,
`x-amz-account-id`,
region
)
SELECT
'{{ AccessGrantsLocationId }}' /* required */,
'{{ AccessGrantsLocationConfiguration }}',
'{{ Grantee }}',
'{{ Permission }}',
'{{ ApplicationArn }}',
'{{ S3PrefixType }}',
'{{ Tags }}',
'{{ x-amz-account-id }}',
'{{ region }}'
RETURNING
access_grant_arn,
access_grant_id,
access_grants_location_configuration,
access_grants_location_id,
application_arn,
created_at,
grant_scope,
grantee,
permission
;

UPDATE examples

Associate your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance. Use this action if you want to create access grants for users or groups from your corporate identity directory. First, you must add your corporate identity directory to Amazon Web Services IAM Identity Center. Then, you can associate this IAM Identity Center instance with your S3 Access Grants instance. Permissions You must have the s3:AssociateAccessGrantsIdentityCenter permission to use this operation. Additional Permissions You must also have the following permissions: sso:CreateApplication, sso:PutApplicationGrant, and sso:PutApplicationAuthenticationMethod.

UPDATE aws.s3control.access_grants
SET
IdentityCenterArn = '{{ IdentityCenterArn }}'
WHERE
`x-amz-account-id` = '{{ x-amz-account-id }}' --required
AND region = '{{ region }}' --required
AND IdentityCenterArn = '{{ IdentityCenterArn }}' --required;

DELETE examples

Deletes the access grant from the S3 Access Grants instance. You cannot undo an access grant deletion and the grantee will no longer have access to the S3 data. Permissions You must have the s3:DeleteAccessGrant permission to use this operation.

DELETE FROM aws.s3control.access_grants
WHERE `x-amz-account-id` = '{{ x-amz-account-id }}' --required
AND id = '{{ id }}' --required
AND region = '{{ region }}' --required
;