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.
Idaws.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.
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.

Methods

NameAccessible byRequired Params
create_resourceINSERTDestinationLocationArn, SourceLocationArn, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all tasks in a region.

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,
status,
source_network_interface_arns,
destination_network_interface_arns
FROM aws.datasync.tasks
WHERE region = 'us-east-1';

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,
status,
source_network_interface_arns,
destination_network_interface_arns
FROM aws.datasync.tasks
WHERE region = 'us-east-1' AND data__Identifier = '<TaskArn>';

INSERT example

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

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

DELETE example

/*+ delete */
DELETE FROM aws.datasync.tasks
WHERE data__Identifier = '<TaskArn>'
AND region = 'us-east-1';

Permissions

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

Create

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

Read

datasync:DescribeTask,
datasync:ListTagsForResource

Update

datasync:UpdateTask,
datasync:DescribeTask,
datasync:ListTagsForResource,
datasync:TagResource,
datasync:UntagResource,
logs:DescribeLogGroups,
iam:PassRole

Delete

datasync:DeleteTask,
ec2:DescribeNetworkInterfaces,
ec2:DeleteNetworkInterface,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
fsx:DescribeFileSystems,
elasticfilesystem:DescribeFileSystems,
elasticfilesystem:DescribeMountTargets,
iam:GetRole

List

datasync:ListTasks