access_grants
Creates, updates, deletes or gets an access_grant
resource or lists access_grants
in a region
Overview
Name | access_grants |
Type | Resource |
Description | The AWS::S3::AccessGrant resource is an Amazon S3 resource type representing permissions to a specific S3 bucket or prefix hosted in an S3 Access Grants instance. |
Id | aws.s3.access_grants |
Fields
Name | Datatype | Description |
---|---|---|
access_grant_id | string | The ID assigned to this access grant. |
access_grants_location_id | string | The custom S3 location to be accessed by the grantee |
tags | array | |
permission | string | The level of access to be afforded to the grantee |
application_arn | string | The ARN of the application grantees will use to access the location |
s3_prefix_type | string | The type of S3SubPrefix. |
grant_scope | string | The S3 path of the data to which you are granting access. It is a combination of the S3 path of the registered location and the subprefix. |
access_grant_arn | string | The Amazon Resource Name (ARN) of the specified access grant. |
grantee | object | The principal who will be granted permission to access S3. |
access_grants_location_configuration | object | The configuration options of the grant location, which is the S3 path to the data to which you are granting access. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Grantee, Permission, AccessGrantsLocationId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all access_grants
in a region.
SELECT
region,
access_grant_id,
access_grants_location_id,
tags,
permission,
application_arn,
s3_prefix_type,
grant_scope,
access_grant_arn,
grantee,
access_grants_location_configuration
FROM aws.s3.access_grants
WHERE region = 'us-east-1';
Gets all properties from an individual access_grant
.
SELECT
region,
access_grant_id,
access_grants_location_id,
tags,
permission,
application_arn,
s3_prefix_type,
grant_scope,
access_grant_arn,
grantee,
access_grants_location_configuration
FROM aws.s3.access_grants
WHERE region = 'us-east-1' AND data__Identifier = '<AccessGrantId>';
INSERT
example
Use the following StackQL query and manifest file to create a new access_grant
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.s3.access_grants (
AccessGrantsLocationId,
Permission,
Grantee,
region
)
SELECT
'{{ AccessGrantsLocationId }}',
'{{ Permission }}',
'{{ Grantee }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.s3.access_grants (
AccessGrantsLocationId,
Tags,
Permission,
ApplicationArn,
S3PrefixType,
Grantee,
AccessGrantsLocationConfiguration,
region
)
SELECT
'{{ AccessGrantsLocationId }}',
'{{ Tags }}',
'{{ Permission }}',
'{{ ApplicationArn }}',
'{{ S3PrefixType }}',
'{{ Grantee }}',
'{{ AccessGrantsLocationConfiguration }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: access_grant
props:
- name: AccessGrantsLocationId
value: '{{ AccessGrantsLocationId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: Permission
value: '{{ Permission }}'
- name: ApplicationArn
value: '{{ ApplicationArn }}'
- name: S3PrefixType
value: '{{ S3PrefixType }}'
- name: Grantee
value:
GranteeType: '{{ GranteeType }}'
GranteeIdentifier: '{{ GranteeIdentifier }}'
- name: AccessGrantsLocationConfiguration
value:
S3SubPrefix: '{{ S3SubPrefix }}'
DELETE
example
/*+ delete */
DELETE FROM aws.s3.access_grants
WHERE data__Identifier = '<AccessGrantId>'
AND region = 'us-east-1';
Permissions
To operate on the access_grants
resource, the following permissions are required:
Create
s3:CreateAccessGrant,
s3:TagResource
Read
s3:GetAccessGrant
Delete
s3:DeleteAccessGrant
List
s3:ListAccessGrants
Update
s3:TagResource