Skip to main content

tasks

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

Overview

Nametasks
TypeResource
Idaws.datasync.tasks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
cloud_watch_log_group_arnstringThe Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task. For more information, see Monitoring data transfers with CloudWatch Logs. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):logs:[a-z-0-9]+:[0-9]{12}:log-group:([^:*]*)(:*)?$</code>)
creation_timestring (date-time)The time that the task was created.
current_task_execution_arnstringThe ARN of the most recent task execution. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z-0-9]+:[0-9]{12}:task/task-[0-9a-f]{17}/execution/exec-[0-9a-f]{17}$</code>)
destination_location_arnstringThe ARN of your transfer's destination location. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$</code>)
destination_network_interface_arnsarrayThe ARNs of the network interfaces that DataSync created for your destination location.
error_codestringIf there's an issue with your task, you can use the error code to help you troubleshoot the problem. For more information, see Troubleshooting issues with DataSync transfers.
error_detailstringIf there's an issue with your task, you can use the error details to help you troubleshoot the problem. For more information, see Troubleshooting issues with DataSync transfers.
excludesarrayThe exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters.
includesarrayThe include filters that define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters.
manifest_configobjectThe configuration of the manifest that lists the files or objects that you want DataSync to transfer. For more information, see Specifying what DataSync transfers by using a manifest.
namestringThe name of your task. (pattern: <code>^[a-zA-Z0-9\s+=._:@/-]+$</code>)
optionsobjectThe task's settings. For example, what file metadata gets preserved, how data integrity gets verified at the end of your transfer, bandwidth limits, among other options.
scheduleobjectThe schedule for when you want your task to run. For more information, see Scheduling your task.
schedule_detailsobjectThe details about your task schedule.
source_location_arnstringThe ARN of your transfer's source location. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$</code>)
source_network_interface_arnsarrayThe ARNs of the network interfaces that DataSync created for your source location.
statusstringThe status of your task. For information about what each status means, see Task statuses. (AVAILABLE, CREATING, QUEUED, RUNNING, UNAVAILABLE)
task_arnstringThe ARN of your task. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z-0-9]+:[0-9]{12}:task/task-[0-9a-f]{17}$</code>)
task_modestringThe task mode that you're using. For more information, see Choosing a task mode for your data transfer. (BASIC, ENHANCED)
task_report_configobjectThe configuration of your task report, which provides detailed information about your DataSync transfer. For more information, see Monitoring your DataSync transfers with task reports.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_taskselectregionProvides information about a task, which defines where and how DataSync transfers your data.
list_tasksselectregionReturns a list of the DataSync tasks you created.
create_taskinsertregion, SourceLocationArn, DestinationLocationArnConfigures a task, which defines where and how DataSync transfers your data. A task includes a source location, destination location, and transfer options (such as bandwidth limits, scheduling, and more). If you're planning to transfer data to or from an Amazon S3 location, review how DataSync can affect your S3 request charges and the DataSync pricing page before you begin.
update_taskupdateregion, TaskArnUpdates the configuration of a task, which defines where and how DataSync transfers your data.
delete_taskdeleteregionDeletes a transfer task resource from DataSync.
cancel_task_executionexecregion, TaskExecutionArnStops an DataSync task execution that's in progress. The transfer of some files are abruptly interrupted. File contents that're transferred to the destination might be incomplete or inconsistent with the source files. However, if you start a new task execution using the same task and allow it to finish, file content on the destination will be complete and consistent. This applies to other unexpected failures that interrupt a task execution. In all of these cases, DataSync successfully completes the transfer when you start the next task execution.
start_task_executionexecregion, TaskArnStarts an DataSync transfer task. For each task, you can only run one task execution at a time. There are several steps to a task execution. For more information, see Task execution statuses. If you're planning to transfer data to or from an Amazon S3 location, review how DataSync can affect your S3 request charges and the DataSync pricing page before you begin.

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)

SELECT examples

Provides information about a task, which defines where and how DataSync transfers your data.

SELECT
cloud_watch_log_group_arn,
creation_time,
current_task_execution_arn,
destination_location_arn,
destination_network_interface_arns,
error_code,
error_detail,
excludes,
includes,
manifest_config,
name,
options,
schedule,
schedule_details,
source_location_arn,
source_network_interface_arns,
status,
task_arn,
task_mode,
task_report_config
FROM aws.datasync.tasks
WHERE region = '{{ region }}' -- required
;

INSERT examples

Configures a task, which defines where and how DataSync transfers your data. A task includes a source location, destination location, and transfer options (such as bandwidth limits, scheduling, and more). If you're planning to transfer data to or from an Amazon S3 location, review how DataSync can affect your S3 request charges and the DataSync pricing page before you begin.

INSERT INTO aws.datasync.tasks (
SourceLocationArn,
DestinationLocationArn,
CloudWatchLogGroupArn,
Name,
Options,
Excludes,
Schedule,
Tags,
Includes,
ManifestConfig,
TaskReportConfig,
TaskMode,
region
)
SELECT
'{{ SourceLocationArn }}' /* required */,
'{{ DestinationLocationArn }}' /* required */,
'{{ CloudWatchLogGroupArn }}',
'{{ Name }}',
'{{ Options }}',
'{{ Excludes }}',
'{{ Schedule }}',
'{{ Tags }}',
'{{ Includes }}',
'{{ ManifestConfig }}',
'{{ TaskReportConfig }}',
'{{ TaskMode }}',
'{{ region }}'
RETURNING
task_arn
;

UPDATE examples

Updates the configuration of a task, which defines where and how DataSync transfers your data.

UPDATE aws.datasync.tasks
SET
TaskArn = '{{ TaskArn }}',
Options = '{{ Options }}',
Excludes = '{{ Excludes }}',
Schedule = '{{ Schedule }}',
Name = '{{ Name }}',
CloudWatchLogGroupArn = '{{ CloudWatchLogGroupArn }}',
Includes = '{{ Includes }}',
ManifestConfig = '{{ ManifestConfig }}',
TaskReportConfig = '{{ TaskReportConfig }}'
WHERE
region = '{{ region }}' --required
AND TaskArn = '{{ TaskArn }}' --required;

DELETE examples

Deletes a transfer task resource from DataSync.

DELETE FROM aws.datasync.tasks
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Stops an DataSync task execution that's in progress. The transfer of some files are abruptly interrupted. File contents that're transferred to the destination might be incomplete or inconsistent with the source files. However, if you start a new task execution using the same task and allow it to finish, file content on the destination will be complete and consistent. This applies to other unexpected failures that interrupt a task execution. In all of these cases, DataSync successfully completes the transfer when you start the next task execution.

EXEC aws.datasync.tasks.cancel_task_execution
@region='{{ region }}' --required
@@json=
'{
"TaskExecutionArn": "{{ TaskExecutionArn }}"
}'
;