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 | awscc.s3.access_grants |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
access_grant_id | string | The ID assigned to this access grant. |
region | string | AWS region. |
For more information, see AWS::S3::AccessGrant.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | access_grants | INSERT | Grantee, Permission, AccessGrantsLocationId, region |
delete_resource | access_grants | DELETE | Identifier, region |
update_resource | access_grants | UPDATE | Identifier, PatchDocument, region |
list_resources | access_grants_list_only | SELECT | region |
get_resource | access_grants | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.s3.access_grants
WHERE
region = '{{ region }}' AND
Identifier = '{{ access_grant_id }}';
Lists all access_grants in a region.
SELECT
region,
access_grant_id
FROM awscc.s3.access_grants_list_only
WHERE
region = '{{ region }}';
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 awscc.s3.access_grants (
AccessGrantsLocationId,
Permission,
Grantee,
region
)
SELECT
'{{ access_grants_location_id }}',
'{{ permission }}',
'{{ grantee }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.s3.access_grants (
AccessGrantsLocationId,
Tags,
Permission,
ApplicationArn,
S3PrefixType,
Grantee,
AccessGrantsLocationConfiguration,
region
)
SELECT
'{{ access_grants_location_id }}',
'{{ tags }}',
'{{ permission }}',
'{{ application_arn }}',
'{{ s3_prefix_type }}',
'{{ grantee }}',
'{{ access_grants_location_configuration }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: access_grant
props:
- name: access_grants_location_id
value: '{{ access_grants_location_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: permission
value: '{{ permission }}'
- name: application_arn
value: '{{ application_arn }}'
- name: s3_prefix_type
value: '{{ s3_prefix_type }}'
- name: grantee
value:
grantee_type: '{{ grantee_type }}'
grantee_identifier: '{{ grantee_identifier }}'
- name: access_grants_location_configuration
value:
s3_sub_prefix: '{{ s3_sub_prefix }}'
UPDATE example
Use the following StackQL query and manifest file to update a access_grant resource, using stack-deploy.
/*+ update */
UPDATE awscc.s3.access_grants
SET PatchDocument = string('{{ {
"AccessGrantsLocationId": access_grants_location_id,
"Permission": permission,
"ApplicationArn": application_arn,
"Grantee": grantee,
"AccessGrantsLocationConfiguration": access_grants_location_configuration
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ access_grant_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.s3.access_grants
WHERE
Identifier = '{{ access_grant_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the access_grants resource, the following permissions are required:
- Create
- Read
- Delete
- List
- Update
s3:CreateAccessGrant,
s3:TagResource
s3:GetAccessGrant,
s3:ListTagsForResource
s3:DeleteAccessGrant
s3:ListAccessGrants
s3:TagResource,
s3:UntagResource