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 | aws.datasync.tasks |
Fields
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. |
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DestinationLocationArn, SourceLocationArn, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.datasync.tasks (
DestinationLocationArn,
SourceLocationArn,
region
)
SELECT
'{{ DestinationLocationArn }}',
'{{ SourceLocationArn }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.datasync.tasks (
Excludes,
Includes,
Tags,
CloudWatchLogGroupArn,
DestinationLocationArn,
Name,
Options,
TaskReportConfig,
ManifestConfig,
Schedule,
SourceLocationArn,
region
)
SELECT
'{{ Excludes }}',
'{{ Includes }}',
'{{ Tags }}',
'{{ CloudWatchLogGroupArn }}',
'{{ DestinationLocationArn }}',
'{{ Name }}',
'{{ Options }}',
'{{ TaskReportConfig }}',
'{{ ManifestConfig }}',
'{{ Schedule }}',
'{{ SourceLocationArn }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: task
props:
- name: Excludes
value:
- FilterType: '{{ FilterType }}'
Value: '{{ Value }}'
- name: Includes
value:
- null
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: CloudWatchLogGroupArn
value: '{{ CloudWatchLogGroupArn }}'
- name: DestinationLocationArn
value: '{{ DestinationLocationArn }}'
- name: Name
value: '{{ Name }}'
- name: Options
value:
Atime: '{{ Atime }}'
BytesPerSecond: '{{ BytesPerSecond }}'
Gid: '{{ Gid }}'
LogLevel: '{{ LogLevel }}'
Mtime: '{{ Mtime }}'
OverwriteMode: '{{ OverwriteMode }}'
PosixPermissions: '{{ PosixPermissions }}'
PreserveDeletedFiles: '{{ PreserveDeletedFiles }}'
PreserveDevices: '{{ PreserveDevices }}'
SecurityDescriptorCopyFlags: '{{ SecurityDescriptorCopyFlags }}'
TaskQueueing: '{{ TaskQueueing }}'
TransferMode: '{{ TransferMode }}'
Uid: '{{ Uid }}'
VerifyMode: '{{ VerifyMode }}'
ObjectTags: '{{ ObjectTags }}'
- name: TaskReportConfig
value:
Destination:
S3:
Subdirectory: '{{ Subdirectory }}'
BucketAccessRoleArn: '{{ BucketAccessRoleArn }}'
S3BucketArn: '{{ S3BucketArn }}'
OutputType: '{{ OutputType }}'
ReportLevel: '{{ ReportLevel }}'
ObjectVersionIds: '{{ ObjectVersionIds }}'
Overrides:
Transferred:
ReportLevel: '{{ ReportLevel }}'
Verified:
ReportLevel: '{{ ReportLevel }}'
Deleted:
ReportLevel: '{{ ReportLevel }}'
Skipped:
ReportLevel: '{{ ReportLevel }}'
- name: ManifestConfig
value:
Action: '{{ Action }}'
Format: '{{ Format }}'
Source:
S3:
ManifestObjectPath: '{{ ManifestObjectPath }}'
BucketAccessRoleArn: '{{ BucketAccessRoleArn }}'
S3BucketArn: '{{ S3BucketArn }}'
ManifestObjectVersionId: '{{ ManifestObjectVersionId }}'
- name: Schedule
value:
ScheduleExpression: '{{ ScheduleExpression }}'
Status: '{{ Status }}'
- name: SourceLocationArn
value: '{{ SourceLocationArn }}'
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