tasks
Creates, updates, deletes or gets a task resource or lists tasks in a region
Overview
| Name | tasks |
| Type | Resource |
| Description | Resource schema for AWS::DataSync::Task. |
| Id | awscc.datasync.tasks |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
excludes | array | |
includes | array | |
tags | array | An array of key-value pairs to apply to this resource. |
cloud_watch_log_group_arn | string | The ARN of the Amazon CloudWatch log group that is used to monitor and log events in the task. |
destination_location_arn | string | The ARN of an AWS storage resource's location. |
name | string | The name of a task. This value is a text reference that is used to identify the task in the console. |
options | object | Represents the options that are available to control the behavior of a StartTaskExecution operation. |
task_report_config | object | Specifies how you want to configure a task report, which provides detailed information about for your Datasync transfer. |
manifest_config | object | Configures a manifest, which is a list of files or objects that you want DataSync to transfer. |
schedule | object | Specifies the schedule you want your task to use for repeated executions. |
source_location_arn | string | The ARN of the source location for the task. |
task_arn | string | The ARN of the task. |
task_mode | string | Specifies the task mode for the task. |
status | string | The status of the task that was described. |
source_network_interface_arns | array | The Amazon Resource Names (ARNs) of the source ENIs (Elastic Network Interfaces) that were created for your subnet. |
destination_network_interface_arns | array | The Amazon Resource Names (ARNs) of the destination ENIs (Elastic Network Interfaces) that were created for your subnet. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
task_arn | string | The ARN of the task. |
region | string | AWS region. |
For more information, see AWS::DataSync::Task.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | tasks | INSERT | DestinationLocationArn, SourceLocationArn, region |
delete_resource | tasks | DELETE | Identifier, region |
update_resource | tasks | UPDATE | Identifier, PatchDocument, region |
list_resources | tasks_list_only | SELECT | region |
get_resource | tasks | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all tasks in a region.
SELECT
region,
task_arn
FROM awscc.datasync.tasks_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new task resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.datasync.tasks (
Excludes,
Includes,
Tags,
CloudWatchLogGroupArn,
DestinationLocationArn,
Name,
Options,
TaskReportConfig,
ManifestConfig,
Schedule,
SourceLocationArn,
TaskMode,
region
)
SELECT
'{{ excludes }}',
'{{ includes }}',
'{{ tags }}',
'{{ cloud_watch_log_group_arn }}',
'{{ destination_location_arn }}',
'{{ name }}',
'{{ options }}',
'{{ task_report_config }}',
'{{ manifest_config }}',
'{{ schedule }}',
'{{ source_location_arn }}',
'{{ task_mode }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: task
props:
- name: excludes
value:
- filter_type: '{{ filter_type }}'
value: '{{ value }}'
- name: includes
value:
- null
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: cloud_watch_log_group_arn
value: '{{ cloud_watch_log_group_arn }}'
- name: destination_location_arn
value: '{{ destination_location_arn }}'
- name: name
value: '{{ name }}'
- name: options
value:
atime: '{{ atime }}'
bytes_per_second: '{{ bytes_per_second }}'
gid: '{{ gid }}'
log_level: '{{ log_level }}'
mtime: '{{ mtime }}'
overwrite_mode: '{{ overwrite_mode }}'
posix_permissions: '{{ posix_permissions }}'
preserve_deleted_files: '{{ preserve_deleted_files }}'
preserve_devices: '{{ preserve_devices }}'
security_descriptor_copy_flags: '{{ security_descriptor_copy_flags }}'
task_queueing: '{{ task_queueing }}'
transfer_mode: '{{ transfer_mode }}'
uid: '{{ uid }}'
verify_mode: '{{ verify_mode }}'
object_tags: '{{ object_tags }}'
- name: task_report_config
value:
destination:
s3:
subdirectory: '{{ subdirectory }}'
bucket_access_role_arn: '{{ bucket_access_role_arn }}'
s3_bucket_arn: '{{ s3_bucket_arn }}'
output_type: '{{ output_type }}'
report_level: '{{ report_level }}'
object_version_ids: '{{ object_version_ids }}'
overrides:
transferred:
report_level: '{{ report_level }}'
verified:
report_level: '{{ report_level }}'
deleted:
report_level: '{{ report_level }}'
skipped:
report_level: '{{ report_level }}'
- name: manifest_config
value:
action: '{{ action }}'
format: '{{ format }}'
source:
s3:
manifest_object_path: '{{ manifest_object_path }}'
bucket_access_role_arn: '{{ bucket_access_role_arn }}'
s3_bucket_arn: '{{ s3_bucket_arn }}'
manifest_object_version_id: '{{ manifest_object_version_id }}'
- name: schedule
value:
schedule_expression: '{{ schedule_expression }}'
status: '{{ status }}'
- name: source_location_arn
value: '{{ source_location_arn }}'
- name: task_mode
value: '{{ task_mode }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Read
- Update
- Delete
- List
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
datasync:DescribeTask,
datasync:ListTagsForResource
datasync:UpdateTask,
datasync:DescribeTask,
datasync:ListTagsForResource,
datasync:TagResource,
datasync:UntagResource,
logs:DescribeLogGroups,
iam:PassRole
datasync:DeleteTask,
ec2:DescribeNetworkInterfaces,
ec2:DeleteNetworkInterface,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
fsx:DescribeFileSystems,
elasticfilesystem:DescribeFileSystems,
elasticfilesystem:DescribeMountTargets,
iam:GetRole
datasync:ListTasks