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::Personalize::Dataset. |
| Id | awscc.personalize.datasets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | The name for the dataset |
dataset_arn | string | The ARN of the dataset |
dataset_type | string | The type of dataset |
dataset_group_arn | string | The Amazon Resource Name (ARN) of the dataset group to add the dataset to |
schema_arn | string | The ARN of the schema to associate with the dataset. The schema defines the dataset fields. |
dataset_import_job | object | Initial DatasetImportJob for the created dataset |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
dataset_arn | string | The ARN of the dataset |
region | string | AWS region. |
For more information, see AWS::Personalize::Dataset.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | datasets | INSERT | Name, DatasetType, DatasetGroupArn, SchemaArn, 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,
name,
dataset_arn,
dataset_type,
dataset_group_arn,
schema_arn,
dataset_import_job
FROM awscc.personalize.datasets
WHERE
region = 'us-east-1' AND
Identifier = '{{ dataset_arn }}';
Lists all datasets in a region.
SELECT
region,
dataset_arn
FROM awscc.personalize.datasets_list_only
WHERE
region = 'us-east-1';
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.personalize.datasets (
Name,
DatasetType,
DatasetGroupArn,
SchemaArn,
region
)
SELECT
'{{ name }}',
'{{ dataset_type }}',
'{{ dataset_group_arn }}',
'{{ schema_arn }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.personalize.datasets (
Name,
DatasetType,
DatasetGroupArn,
SchemaArn,
DatasetImportJob,
region
)
SELECT
'{{ name }}',
'{{ dataset_type }}',
'{{ dataset_group_arn }}',
'{{ schema_arn }}',
'{{ dataset_import_job }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: dataset
props:
- name: name
value: '{{ name }}'
- name: dataset_type
value: '{{ dataset_type }}'
- name: dataset_group_arn
value: '{{ dataset_group_arn }}'
- name: schema_arn
value: '{{ schema_arn }}'
- name: dataset_import_job
value:
job_name: '{{ job_name }}'
dataset_import_job_arn: '{{ dataset_import_job_arn }}'
dataset_arn: '{{ dataset_arn }}'
data_source:
data_location: '{{ data_location }}'
role_arn: '{{ role_arn }}'
UPDATE example
Use the following StackQL query and manifest file to update a dataset resource, using stack-deploy.
/*+ update */
UPDATE awscc.personalize.datasets
SET PatchDocument = string('{{ {
"DatasetImportJob": dataset_import_job
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ dataset_arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.personalize.datasets
WHERE
Identifier = '{{ dataset_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the datasets resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
personalize:CreateDataset,
personalize:DescribeDataset,
personalize:CreateDatasetImportJob,
personalize:DescribeDatasetImportJob,
iam:PassRole
personalize:DescribeDataset
personalize:DescribeDataset,
personalize:CreateDatasetImportJob,
personalize:DescribeDatasetImportJob,
iam:PassRole
personalize:DeleteDataset,
personalize:DescribeDataset
personalize:ListDatasets