AWS::DataSync::Task - AWS CloudFormation


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.


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


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


Type: AWS::DataSync::Task Properties: CloudWatchLogGroupArn: String DestinationLocationArn: String Excludes: - FilterRule Name: String Options: Options Schedule: TaskSchedule SourceLocationArn: String Tags: - Tag



The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the task.

For more information about how to use CloudWatch Logs with DataSync, see Monitoring Your Task in the AWS DataSync User Guide.

For more information about these groups, see Working with Log Groups and Log Streams in the Amazon CloudWatch Logs User Guide.

Required: No

Type: String

Maximum: 562

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

Update requires: No interruption


Not currently supported by AWS CloudFormation.

Required: Yes

Type: String

Update requires: Replacement


A list of filter rules that determines which files to exclude from a task. The list should contain a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, "/folder1|/folder2".

Required: No

Type: List of FilterRule

Maximum: 1

Update requires: No interruption


The name of a task. This value is a text reference that is used to identify the task in the console.

Required: No

Type: String

Minimum: 1

Maximum: 256

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

Update requires: No interruption


The set of configuration options that control the behavior of a single execution of the task that occurs when you call StartTaskExecution. You can configure these options to preserve metadata such as user ID (UID) and group ID (GID), file permissions, data integrity verification, and so on.

For each individual task execution, you can override these options by specifying the OverrideOptions before starting the task execution. For more information, see the API_StartTaskExecution operation.

Required: No

Type: Options

Update requires: No interruption


Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule should be specified in UTC time. For more information, see task-scheduling.

Required: No

Type: TaskSchedule

Update requires: No interruption


The Amazon Resource Name (ARN) of the source location for the task.

Required: Yes

Type: String

Maximum: 128

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}$

Update requires: Replacement


The key-value pair that represents the tag that you want to add to the resource. The value can be an empty string.

Required: No

Type: List of Tag

Maximum: 50

Update requires: No interruption

Return values


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


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


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.


Not currently supported by AWS CloudFormation.


Errors that AWS DataSync encountered during execution of the task. You can use this error code to help troubleshoot issues.


Detailed description of an error that was encountered during the task execution. You can use this information to help troubleshoot issues.


The status of the task that was described.


The Amazon Resource Name (ARN) of the task.


DataSync Task

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


{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Specifies a DataSync task", "Resources": { "Agent": { "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" } } }


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