tasks
Creates, updates, deletes, gets or lists a tasks resource.
Overview
| Name | tasks |
| Type | Resource |
| Id | aws.iotsitewise.tasks |
Fields
The following fields are returned by SELECT queries:
- describe_task
- list_tasks
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The time the task was created, in Unix epoch time. |
description | string | The description of the task. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
status | object | The current lifecycle status of the task. |
task_arn | string | The ARN of the task. (pattern: <code>^arn:aws(-cn|-us-gov)?:[a-zA-Z0-9-:/_.]+$</code>) |
task_configuration | object | The task execution configuration. Specify a containerTaskConfiguration for a custom container workload. |
task_name | string | Reusable resource name with alphanumeric, hyphen, and underscore characters. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
updated_at | string (date-time) | The time the task was last updated, in Unix epoch time. |
version | string | The version of the task. (pattern: <code>^(0|([1-9]{1}\d*))$</code>) |
workspace_name | string | The name of the workspace. (pattern: <code>^[a-zA-Z0-9_-]+$</code>) |
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The time the task was created, in Unix epoch time. |
description | string | The description of the task. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
status | object | The current lifecycle status of the task. |
task_arn | string | The ARN of the task. (pattern: <code>^arn:aws(-cn|-us-gov)?:[a-zA-Z0-9-:/_.]+$</code>) |
task_name | string | Reusable resource name with alphanumeric, hyphen, and underscore characters. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
updated_at | string (date-time) | The time the task was last updated, in Unix epoch time. |
version | string | The version of the task. (pattern: <code>^(0|([1-9]{1}\d*))$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_task | select | workspace_name, task_name, region | version | Retrieves detailed information about a specific task in a workspace. |
list_tasks | select | workspace_name, region | nextToken, maxResults | Lists tasks in a workspace. To get complete details about a task, use DescribeTask. |
create_task | insert | workspace_name, region, taskName, taskConfiguration | Creates a new task in the specified workspace. A task defines a reusable containerized compute workload that can be referenced by one or more pipeline compute nodes. Specify a containerTaskConfiguration for custom container workloads with configurable ECR image, processing type, processing unit, and environment variables. | |
update_task | update | workspace_name, task_name, region | Updates an existing task in the specified workspace. Only the fields provided in the request are updated; fields not included in the request are preserved unchanged. | |
delete_task | delete | workspace_name, task_name, region | Deletes a task from the specified workspace. A task cannot be deleted if it is currently referenced by any existing pipeline. Remove the task from all pipelines before attempting to delete it. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
task_name | string | The name of the task to delete. |
workspace_name | string | The name of the workspace. |
maxResults | integer | The maximum number of results to return for each paginated request. Default: 50. |
nextToken | string | The token to be used for the next set of paginated results. |
version | string | The version number of the task to retrieve. If not specified, returns the latest version. |
SELECT examples
- describe_task
- list_tasks
Retrieves detailed information about a specific task in a workspace.
SELECT
created_at,
description,
status,
task_arn,
task_configuration,
task_name,
updated_at,
version,
workspace_name
FROM aws.iotsitewise.tasks
WHERE workspace_name = '{{ workspace_name }}' -- required
AND task_name = '{{ task_name }}' -- required
AND region = '{{ region }}' -- required
AND version = '{{ version }}'
;
Lists tasks in a workspace. To get complete details about a task, use DescribeTask.
SELECT
created_at,
description,
status,
task_arn,
task_name,
updated_at,
version
FROM aws.iotsitewise.tasks
WHERE workspace_name = '{{ workspace_name }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_task
- Manifest
Creates a new task in the specified workspace. A task defines a reusable containerized compute workload that can be referenced by one or more pipeline compute nodes. Specify a containerTaskConfiguration for custom container workloads with configurable ECR image, processing type, processing unit, and environment variables.
INSERT INTO aws.iotsitewise.tasks (
taskName,
description,
taskConfiguration,
tags,
clientToken,
workspace_name,
region
)
SELECT
'{{ taskName }}' /* required */,
'{{ description }}',
'{{ taskConfiguration }}' /* required */,
'{{ tags }}',
'{{ clientToken }}',
'{{ workspace_name }}',
'{{ region }}'
RETURNING
status,
task_arn,
task_name,
version
;
# Description fields are for documentation purposes
- name: tasks
props:
- name: workspace_name
value: "{{ workspace_name }}"
description: Required parameter for the tasks resource.
- name: region
value: "{{ region }}"
description: Required parameter for the tasks resource.
- name: taskName
value: "{{ taskName }}"
description: |
Reusable resource name with alphanumeric, hyphen, and underscore characters.
- name: description
value: "{{ description }}"
- name: taskConfiguration
description: |
The task execution configuration. Specify a containerTaskConfiguration for a custom container workload.
value:
containerTaskConfiguration:
ecrUri: "{{ ecrUri }}"
taskExecutionRole: "{{ taskExecutionRole }}"
processingType: "{{ processingType }}"
processingUnit: "{{ processingUnit }}"
command:
- "{{ command }}"
timeoutSeconds: {{ timeoutSeconds }}
environmentVariables: "{{ environmentVariables }}"
- name: tags
value: "{{ tags }}"
- name: clientToken
value: "{{ clientToken }}"
UPDATE examples
- update_task
Updates an existing task in the specified workspace. Only the fields provided in the request are updated; fields not included in the request are preserved unchanged.
UPDATE aws.iotsitewise.tasks
SET
description = '{{ description }}',
taskConfiguration = '{{ taskConfiguration }}'
WHERE
workspace_name = '{{ workspace_name }}' --required
AND task_name = '{{ task_name }}' --required
AND region = '{{ region }}' --required
RETURNING
status,
version;
DELETE examples
- delete_task
Deletes a task from the specified workspace. A task cannot be deleted if it is currently referenced by any existing pipeline. Remove the task from all pipelines before attempting to delete it.
DELETE FROM aws.iotsitewise.tasks
WHERE workspace_name = '{{ workspace_name }}' --required
AND task_name = '{{ task_name }}' --required
AND region = '{{ region }}' --required
;