Skip to main content

tasks

Creates, updates, deletes or gets a task resource or lists tasks in a region

Overview

Nametasks
TypeResource
DescriptionResource schema for AWS::DataSync::Task.
Idawscc.datasync.tasks

Fields

NameDatatypeDescription
excludesarray
includesarray
tagsarrayAn array of key-value pairs to apply to this resource.
cloud_watch_log_group_arnstringThe ARN of the Amazon CloudWatch log group that is used to monitor and log events in the task.
destination_location_arnstringThe ARN of an AWS storage resource's location.
namestringThe name of a task. This value is a text reference that is used to identify the task in the console.
optionsobjectRepresents the options that are available to control the behavior of a StartTaskExecution operation.
task_report_configobjectSpecifies how you want to configure a task report, which provides detailed information about for your Datasync transfer.
manifest_configobjectConfigures a manifest, which is a list of files or objects that you want DataSync to transfer.
scheduleobjectSpecifies the schedule you want your task to use for repeated executions.
source_location_arnstringThe ARN of the source location for the task.
task_arnstringThe ARN of the task.
task_modestringSpecifies the task mode for the task.
statusstringThe status of the task that was described.
source_network_interface_arnsarrayThe Amazon Resource Names (ARNs) of the source ENIs (Elastic Network Interfaces) that were created for your subnet.
destination_network_interface_arnsarrayThe Amazon Resource Names (ARNs) of the destination ENIs (Elastic Network Interfaces) that were created for your subnet.
regionstringAWS region.

For more information, see AWS::DataSync::Task.

Methods

NameResourceAccessible byRequired Params
create_resourcetasksINSERTDestinationLocationArn, SourceLocationArn, region
delete_resourcetasksDELETEIdentifier, region
update_resourcetasksUPDATEIdentifier, PatchDocument, region
list_resourcestasks_list_onlySELECTregion
get_resourcetasksSELECTIdentifier, region

SELECT examples

Gets all properties from an individual task.

SELECT
region,
excludes,
includes,
tags,
cloud_watch_log_group_arn,
destination_location_arn,
name,
options,
task_report_config,
manifest_config,
schedule,
source_location_arn,
task_arn,
task_mode,
status,
source_network_interface_arns,
destination_network_interface_arns
FROM awscc.datasync.tasks
WHERE
region = 'us-east-1' AND
Identifier = '{{ task_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new task resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.datasync.tasks (
DestinationLocationArn,
SourceLocationArn,
region
)
SELECT
'{{ destination_location_arn }}',
'{{ source_location_arn }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a task resource, using stack-deploy.

/*+ update */
UPDATE awscc.datasync.tasks
SET PatchDocument = string('{{ {
"Excludes": excludes,
"Includes": includes,
"Tags": tags,
"CloudWatchLogGroupArn": cloud_watch_log_group_arn,
"Name": name,
"Options": options,
"TaskReportConfig": task_report_config,
"ManifestConfig": manifest_config,
"Schedule": schedule
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ task_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.datasync.tasks
WHERE
Identifier = '{{ task_arn }}' AND
region = 'us-east-1';

Permissions

To operate on the tasks resource, the following permissions are required:

datasync:CreateTask,
datasync:DescribeTask,
datasync:ListTagsForResource,
datasync:TagResource,
s3:ListAllMyBuckets,
s3:ListBucket,
s3:GetObject,
s3:GetObjectVersion,
ec2:DescribeNetworkInterfaces,
ec2:CreateNetworkInterface,
ec2:DeleteNetworkInterface,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:CreateNetworkInterfacePermission,
fsx:DescribeFileSystems,
elasticfilesystem:DescribeFileSystems,
elasticfilesystem:DescribeMountTargets,
logs:DescribeLogGroups,
iam:GetRole,
iam:PassRole,
iam:AssumeRole