Skip to main content

tasks

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

Overview​

Nametasks
TypeResource
Idaws.iotsitewise.tasks

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The time the task was created, in Unix epoch time.
descriptionstringThe description of the task. (pattern: <code>[^\u0000-\u001F\u007F]+</code>)
statusobjectThe current lifecycle status of the task.
task_arnstringThe ARN of the task. (pattern: <code>^arn:aws(-cn|-us-gov)?:[a-zA-Z0-9-:/_.]+$</code>)
task_configurationobjectThe task execution configuration. Specify a containerTaskConfiguration for a custom container workload.
task_namestringReusable resource name with alphanumeric, hyphen, and underscore characters. (pattern: <code>[a-zA-Z0-9_-]+</code>)
updated_atstring (date-time)The time the task was last updated, in Unix epoch time.
versionstringThe version of the task. (pattern: <code>^(0|([1-9]{1}\d*))$</code>)
workspace_namestringThe name of the workspace. (pattern: <code>^[a-zA-Z0-9_-]+$</code>)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_taskselectworkspace_name, task_name, regionversionRetrieves detailed information about a specific task in a workspace.
list_tasksselectworkspace_name, regionnextToken, maxResultsLists tasks in a workspace. To get complete details about a task, use DescribeTask.
create_taskinsertworkspace_name, region, taskName, taskConfigurationCreates 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_taskupdateworkspace_name, task_name, regionUpdates 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_taskdeleteworkspace_name, task_name, regionDeletes 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
task_namestringThe name of the task to delete.
workspace_namestringThe name of the workspace.
maxResultsintegerThe maximum number of results to return for each paginated request. Default: 50.
nextTokenstringThe token to be used for the next set of paginated results.
versionstringThe version number of the task to retrieve. If not specified, returns the latest version.

SELECT examples​

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 }}'
;

INSERT examples​

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
;

UPDATE examples​

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​

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
;