Skip to main content

data_grants

Creates, updates, deletes, gets or lists a data_grants resource.

Overview

Namedata_grants
TypeResource
Idaws.dataexchange.data_grants

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
acceptance_statestringThe acceptance state of the data grant. (PENDING_RECEIVER_ACCEPTANCE, ACCEPTED)
accepted_atstring (date-time)The timestamp of when the data grant was accepted.
arnstringThe Amazon Resource Name (ARN) of the data grant.
created_atstring (date-time)The timestamp of when the data grant was created.
data_set_idstringThe ID of the data set associated to the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>)
descriptionstringThe description of the data grant.
ends_atstring (date-time)The timestamp of when access to the associated data set ends.
grant_distribution_scopestringThe distribution scope for the data grant. (AWS_ORGANIZATION, NONE)
idstringThe ID of the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>)
namestringThe name of the data grant.
receiver_principalstringThe Amazon Web Services account ID of the data grant receiver. (pattern: <code>\d{12}</code>)
sender_principalstringThe Amazon Web Services account ID of the data grant sender. (pattern: <code>\d{12}</code>)
source_data_set_idstringThe ID of the data set used to create the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>)
tagsobjectThe tags associated to the data grant. A tag is a key-value pair.
updated_atstring (date-time)The timestamp of when the data grant was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_data_grantselectdata_grant_id, regionThis operation returns information about a data grant.
list_data_grantsselectregionmaxResults, nextTokenThis operation returns information about all data grants.
create_data_grantinsertregion, GrantDistributionScope, ReceiverPrincipal, SourceDataSetIdThis operation creates a data grant.
delete_data_grantdeletedata_grant_id, regionThis operation deletes a data grant.
accept_data_grantexecdata_grant_arn, regionThis operation accepts a data grant.

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
data_grant_arnstringThe Amazon Resource Name (ARN) of the data grant to accept.
data_grant_idstringThe ID of the data grant to delete.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to be included in the next page.
nextTokenstringThe pagination token used to retrieve the next page of results for this operation.

SELECT examples

This operation returns information about a data grant.

SELECT
acceptance_state,
accepted_at,
arn,
created_at,
data_set_id,
description,
ends_at,
grant_distribution_scope,
id,
name,
receiver_principal,
sender_principal,
source_data_set_id,
tags,
updated_at
FROM aws.dataexchange.data_grants
WHERE data_grant_id = '{{ data_grant_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

This operation creates a data grant.

INSERT INTO aws.dataexchange.data_grants (
Name,
GrantDistributionScope,
ReceiverPrincipal,
SourceDataSetId,
EndsAt,
Description,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ GrantDistributionScope }}' /* required */,
'{{ ReceiverPrincipal }}' /* required */,
'{{ SourceDataSetId }}' /* required */,
'{{ EndsAt }}',
'{{ Description }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
acceptance_state,
accepted_at,
arn,
created_at,
data_set_id,
description,
ends_at,
grant_distribution_scope,
id,
name,
receiver_principal,
sender_principal,
source_data_set_id,
tags,
updated_at
;

DELETE examples

This operation deletes a data grant.

DELETE FROM aws.dataexchange.data_grants
WHERE data_grant_id = '{{ data_grant_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

This operation accepts a data grant.

EXEC aws.dataexchange.data_grants.accept_data_grant
@data_grant_arn='{{ data_grant_arn }}' --required,
@region='{{ region }}' --required
;