data_grants
Creates, updates, deletes, gets or lists a data_grants resource.
Overview
| Name | data_grants |
| Type | Resource |
| Id | aws.dataexchange.data_grants |
Fields
The following fields are returned by SELECT queries:
- get_data_grant
- list_data_grants
| Name | Datatype | Description |
|---|---|---|
acceptance_state | string | The acceptance state of the data grant. (PENDING_RECEIVER_ACCEPTANCE, ACCEPTED) |
accepted_at | string (date-time) | The timestamp of when the data grant was accepted. |
arn | string | The Amazon Resource Name (ARN) of the data grant. |
created_at | string (date-time) | The timestamp of when the data grant was created. |
data_set_id | string | The ID of the data set associated to the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
description | string | The description of the data grant. |
ends_at | string (date-time) | The timestamp of when access to the associated data set ends. |
grant_distribution_scope | string | The distribution scope for the data grant. (AWS_ORGANIZATION, NONE) |
id | string | The ID of the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
name | string | The name of the data grant. |
receiver_principal | string | The Amazon Web Services account ID of the data grant receiver. (pattern: <code>\d{12}</code>) |
sender_principal | string | The Amazon Web Services account ID of the data grant sender. (pattern: <code>\d{12}</code>) |
source_data_set_id | string | The ID of the data set used to create the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
tags | object | The tags associated to the data grant. A tag is a key-value pair. |
updated_at | string (date-time) | The timestamp of when the data grant was last updated. |
| Name | Datatype | Description |
|---|---|---|
acceptance_state | string | The acceptance state of the data grant. (PENDING_RECEIVER_ACCEPTANCE, ACCEPTED) |
accepted_at | string (date-time) | The timestamp of when the data grant was accepted. |
arn | string | The Amazon Resource Name (ARN) of the data grant. |
created_at | string (date-time) | The timestamp of when the data grant was created. |
data_set_id | string | The ID of the data set associated to the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
ends_at | string (date-time) | The timestamp of when access to the associated data set ends. |
id | string | The ID of the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
name | string | The name of the data grant. |
receiver_principal | string | The Amazon Web Services account ID of the data grant receiver. (pattern: <code>\d{12}</code>) |
sender_principal | string | The Amazon Web Services account ID of the data grant sender. (pattern: <code>\d{12}</code>) |
source_data_set_id | string | The ID of the data set used to create the data grant. (pattern: <code>[a-zA-Z0-9]{30,40}</code>) |
updated_at | string (date-time) | The timestamp of when the data grant was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_data_grant | select | data_grant_id, region | This operation returns information about a data grant. | |
list_data_grants | select | region | maxResults, nextToken | This operation returns information about all data grants. |
create_data_grant | insert | region, GrantDistributionScope, ReceiverPrincipal, SourceDataSetId | This operation creates a data grant. | |
delete_data_grant | delete | data_grant_id, region | This operation deletes a data grant. | |
accept_data_grant | exec | data_grant_arn, region | This 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.
| Name | Datatype | Description |
|---|---|---|
data_grant_arn | string | The Amazon Resource Name (ARN) of the data grant to accept. |
data_grant_id | string | The ID of the data grant to delete. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to be included in the next page. |
nextToken | string | The pagination token used to retrieve the next page of results for this operation. |
SELECT examples
- get_data_grant
- list_data_grants
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
;
This operation returns information about all data grants.
SELECT
acceptance_state,
accepted_at,
arn,
created_at,
data_set_id,
ends_at,
id,
name,
receiver_principal,
sender_principal,
source_data_set_id,
updated_at
FROM aws.dataexchange.data_grants
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_data_grant
- Manifest
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
;
# Description fields are for documentation purposes
- name: data_grants
props:
- name: region
value: "{{ region }}"
description: Required parameter for the data_grants resource.
- name: Name
value: "{{ Name }}"
- name: GrantDistributionScope
value: "{{ GrantDistributionScope }}"
valid_values: ['AWS_ORGANIZATION', 'NONE']
- name: ReceiverPrincipal
value: "{{ ReceiverPrincipal }}"
- name: SourceDataSetId
value: "{{ SourceDataSetId }}"
- name: EndsAt
value: "{{ EndsAt }}"
- name: Description
value: "{{ Description }}"
- name: Tags
value: "{{ Tags }}"
DELETE examples
- delete_data_grant
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
- accept_data_grant
This operation accepts a data grant.
EXEC aws.dataexchange.data_grants.accept_data_grant
@data_grant_arn='{{ data_grant_arn }}' --required,
@region='{{ region }}' --required
;