access_grants
Creates, updates, deletes, gets or lists an access_grants resource.
Overview
| Name | access_grants |
| Type | Resource |
| Id | aws.s3control.access_grants |
Fields
The following fields are returned by SELECT queries:
- get_access_grant
- list_access_grants
| Name | Datatype | Description |
|---|---|---|
access_grant_arn | string | The Amazon Resource Name (ARN) of the access grant. |
access_grant_id | string | The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant. |
access_grants_location_configuration | string | The 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_id | 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. |
application_arn | 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. |
created_at | string | The date and time when you created the access grant. |
grant_scope | 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 | string | The 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. |
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. |
| Name | Datatype | Description |
|---|---|---|
access_grant_arn | string | The Amazon Resource Name (ARN) of the access grant. |
access_grant_id | string | The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant. |
access_grants_location_configuration | string | The 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_id | 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. |
application_arn | 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. |
created_at | string | The date and time when you created the S3 Access Grants instance. |
grant_scope | 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 | string | The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added your corporate directory to Amazon Web Services IAM Identity Center and associated your Identity Center instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group. |
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. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_access_grant | select | x-amz-account-id, id, region | 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. | |
list_access_grants | select | x-amz-account-id, region | nextToken, maxResults, granteetype, granteeidentifier, permission, grantscope, application_arn | Returns 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_grant | insert | x-amz-account-id, region, AccessGrantsLocationId | 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 | |
associate_access_grants_identity_center | update | x-amz-account-id, region, IdentityCenterArn | 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. | |
delete_access_grant | delete | x-amz-account-id, id, region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant. |
region | string | AWS region (default: us-east-1) |
x-amz-account-id | string | The Amazon Web Services account ID of the S3 Access Grants instance. |
application_arn | 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. |
granteeidentifier | string | The 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. |
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 - 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. |
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. |
maxResults | 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. |
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. |
permission | 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. |
SELECT examples
- get_access_grant
- list_access_grants
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
;
Returns the list of access grants in your S3 Access Grants instance. Permissions You must have the s3:ListAccessGrants 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 region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND granteetype = '{{ granteetype }}'
AND granteeidentifier = '{{ granteeidentifier }}'
AND permission = '{{ permission }}'
AND grantscope = '{{ grantscope }}'
AND application_arn = '{{ application_arn }}'
;
INSERT examples
- create_access_grant
- Manifest
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
;
# Description fields are for documentation purposes
- name: access_grants
props:
- name: x-amz-account-id
value: "{{ x-amz-account-id }}"
description: Required parameter for the access_grants resource.
- name: region
value: "{{ region }}"
description: Required parameter for the access_grants resource.
- name: AccessGrantsLocationId
value: "{{ AccessGrantsLocationId }}"
- name: AccessGrantsLocationConfiguration
description: |
The configuration options of the S3 Access Grants location. It contains the S3SubPrefix field. The grant scope, the data to which you are granting access, is the result of appending the Subprefix field to the scope of the registered location.
value:
S3SubPrefix: "{{ S3SubPrefix }}"
- name: Grantee
description: |
The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added your corporate directory to Amazon Web Services IAM Identity Center and associated your Identity Center instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group.
value:
GranteeType: "{{ GranteeType }}"
GranteeIdentifier: "{{ GranteeIdentifier }}"
- name: Permission
value: "{{ Permission }}"
valid_values: ['READ', 'WRITE', 'READWRITE']
- name: ApplicationArn
value: "{{ ApplicationArn }}"
- name: S3PrefixType
value: "{{ S3PrefixType }}"
valid_values: ['Object']
- name: Tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- associate_access_grants_identity_center
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
- delete_access_grant
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
;