AWS::DataSync::Task - AWS CloudFormation

AWS::DataSync::Task

The AWS::DataSync::Task resource specifies a task. A task is a set of two locations (source and destination) and a set of Options that you use to control the behavior of a task. If you don't specify Options when you create a task, AWS DataSync populates them with service defaults.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::DataSync::Task", "Properties" : { "CloudWatchLogGroupArn" : String, "DestinationLocationArn" : String, "Excludes" : [ FilterRule, ... ], "Includes" : [ FilterRule, ... ], "ManifestConfig" : ManifestConfig, "Name" : String, "Options" : Options, "Schedule" : TaskSchedule, "SourceLocationArn" : String, "Tags" : [ Tag, ... ], "TaskReportConfig" : TaskReportConfig } }

Properties

CloudWatchLogGroupArn

Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.

For more information, see Monitoring DataSync with Amazon CloudWatch.

Required: No

Type: String

Pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\-0-9]*:[0-9]{12}:log-group:([^:\*]*)(:\*)?$

Maximum: 562

Update requires: No interruption

DestinationLocationArn

The Amazon Resource Name (ARN) of an AWS storage resource's location.

Required: Yes

Type: String

Pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$

Maximum: 128

Update requires: Replacement

Excludes

Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters.

Required: No

Type: Array of FilterRule

Minimum: 0

Maximum: 1

Update requires: No interruption

Includes

Specifies include filters define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters.

Required: No

Type: Array of FilterRule

Minimum: 0

Maximum: 1

Update requires: No interruption

ManifestConfig

The configuration of the manifest that lists the files or objects that you want DataSync to transfer. For more information, see Specifying what DataSync transfers by using a manifest.

Required: No

Type: ManifestConfig

Update requires: No interruption

Name

Specifies the name of your task.

Required: No

Type: String

Pattern: ^[a-zA-Z0-9\s+=._:@/-]+$

Minimum: 1

Maximum: 256

Update requires: No interruption

Options

Specifies your task's settings, such as preserving file metadata, verifying data integrity, among other options.

Required: No

Type: Options

Update requires: No interruption

Schedule

Specifies a schedule for when you want your task to run. For more information, see Scheduling your task.

Required: No

Type: TaskSchedule

Update requires: No interruption

SourceLocationArn

Specifies the ARN of your transfer's source location.

Required: Yes

Type: String

Pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$

Maximum: 128

Update requires: Replacement

Tags

Specifies the tags that you want to apply to your task.

Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.

Required: No

Type: Array of Tag

Maximum: 50

Update requires: No interruption

TaskReportConfig

Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see Monitoring your DataSync transfers with task reports.

When using this parameter, your caller identity (the role that you're using DataSync with) must have the iam:PassRole permission. The AWSDataSyncFullAccess policy includes this permission.

Required: No

Type: TaskReportConfig

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the location resource ARN. For example:

arn:aws:datasync:us-east-2:111222333444:task/task-07db7abfc326c50s3

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

DestinationNetworkInterfaceArns

The ARNs of the destination elastic network interfaces (ENIs) that were created for your subnet.

SourceNetworkInterfaceArns

The ARNs of the source ENIs that were created for your subnet.

Status

The status of the task that was described.

TaskArn

The ARN of the task.

Examples

DataSync Task

The following example specifies a DataSync task using a source and destination location.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Specifies a DataSync task", "Resources": { "Task": { "Type": "AWS::DataSync::Task", "Properties": { "SourceLocationArn": "arn:aws:datasync:us-east-2:111222333444:location/loc-07db7abfc326c50s3", "DestinationLocationArn": "arn:aws:datasync:us-east-2:111222333444:location/loc-18ec8bcgd437d61t4" } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Description: Specifies a DataSync task Resources: Task: Type: AWS::DataSync::Task Properties: SourceLocationArn: arn:aws:datasync:us-east-2:111222333444:location/loc-07db7abfc326c50s3 DestinationLocationArn: arn:aws:datasync:us-east-2:111222333444:location/loc-18ec8bcgd437d61t4