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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.datasync.tasks
WHERE
Identifier = '{{ task_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

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