datasets
Creates, updates, deletes or gets a dataset resource or lists datasets in a region
Overview
| Name | datasets |
| Type | Resource |
| Description | Resource schema for AWS::IoTSiteWise::Dataset. |
| Id | awscc.iotsitewise.datasets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
dataset_id | string | The ID of the dataset. |
dataset_arn | string | The ARN of the dataset. |
dataset_name | string | The name of the dataset. |
dataset_description | string | A description about the dataset, and its functionality. |
dataset_source | object | The data source for the dataset. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
dataset_id | string | The ID of the dataset. |
region | string | AWS region. |
For more information, see AWS::IoTSiteWise::Dataset.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | datasets | INSERT | DatasetName, DatasetSource, region |
delete_resource | datasets | DELETE | Identifier, region |
update_resource | datasets | UPDATE | Identifier, PatchDocument, region |
list_resources | datasets_list_only | SELECT | region |
get_resource | datasets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual dataset.
SELECT
region,
dataset_id,
dataset_arn,
dataset_name,
dataset_description,
dataset_source,
tags
FROM awscc.iotsitewise.datasets
WHERE
region = '{{ region }}' AND
Identifier = '{{ dataset_id }}';
Lists all datasets in a region.
SELECT
region,
dataset_id
FROM awscc.iotsitewise.datasets_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new dataset resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iotsitewise.datasets (
DatasetName,
DatasetSource,
region
)
SELECT
'{{ dataset_name }}',
'{{ dataset_source }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.iotsitewise.datasets (
DatasetName,
DatasetDescription,
DatasetSource,
Tags,
region
)
SELECT
'{{ dataset_name }}',
'{{ dataset_description }}',
'{{ dataset_source }}',
'{{ tags }}',
'{{ 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: dataset
props:
- name: dataset_name
value: '{{ dataset_name }}'
- name: dataset_description
value: '{{ dataset_description }}'
- name: dataset_source
value:
source_format: '{{ source_format }}'
source_type: '{{ source_type }}'
source_detail:
kendra:
knowledge_base_arn: '{{ knowledge_base_arn }}'
role_arn: '{{ role_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a dataset resource, using stack-deploy.
/*+ update */
UPDATE awscc.iotsitewise.datasets
SET PatchDocument = string('{{ {
"DatasetName": dataset_name,
"DatasetDescription": dataset_description,
"DatasetSource": dataset_source,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ dataset_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.iotsitewise.datasets
WHERE
Identifier = '{{ dataset_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 datasets resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iotsitewise:CreateDataset,
iotsitewise:DescribeDataset,
iam:PassRole,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource
iotsitewise:DescribeDataset,
iotsitewise:ListTagsForResource
iotsitewise:UpdateDataset,
iotsitewise:DescribeDataset,
iam:PassRole,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:UntagResource
iotsitewise:DeleteDataset,
iotsitewise:DescribeDataset,
iotsitewise:ListTagsForResource
iotsitewise:ListDatasets,
iotsitewise:ListTagsForResource