This is the new AWS CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
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, ... ], "TaskMode" :String, "TaskReportConfig" :TaskReportConfig} }
YAML
Type: AWS::DataSync::Task Properties: CloudWatchLogGroupArn:StringDestinationLocationArn:StringExcludes:- FilterRuleIncludes:- FilterRuleManifestConfig:ManifestConfigName:StringOptions:OptionsSchedule:TaskScheduleSourceLocationArn:StringTags:- TagTaskMode:StringTaskReportConfig:TaskReportConfig
Properties
- CloudWatchLogGroupArn
- 
                    Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task. For Enhanced mode tasks, you don't need to specify anything. DataSync automatically sends logs to a CloudWatch log group named /aws/datasync.For more information, see Monitoring data transfers with CloudWatch Logs. 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: 562Update 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: 128Update 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: 0Maximum: 1Update requires: No interruption 
- Includes
- 
                    Specifies include filters that 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: 0Maximum: 1Update 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: 1Maximum: 256Update 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: 128Update requires: Replacement 
- 
                    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: 50Update requires: No interruption 
- TaskMode
- 
                    The task mode that you're using. For more information, see Choosing a task mode for your data transfer. Required: No Type: String Allowed values: BASIC | ENHANCEDUpdate requires: Replacement 
- TaskReportConfig
- 
                    The configuration of your task report, which provides detailed information about your DataSync transfer. For more information, see Monitoring your DataSync transfers with task reports. 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
Creating an Enhanced mode task
The following examples create an Enhanced mode task. For more information, see Choosing a task mode for your data transfer.
JSON
{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Creates a DataSync task that uses Enhanced mode", "Resources": { "Task": { "Type": "AWS::DataSync::Task", "Properties": { "SourceLocationArn": "arn:aws:datasync:us-east-2:111222333444:location/loc-1111aaaa2222bbbb3", "DestinationLocationArn": "arn:aws:datasync:us-east-2:111222333444:location/loc-0000zzzz1111yyyy2", "Name": "My-Enhanced-mode-task", "TaskMode": "ENHANCED", "Options": { "TransferMode": "CHANGED", "VerifyMode": "ONLY_FILES_TRANSFERRED", "ObjectTags": "PRESERVE", "LogLevel": "TRANSFER" } } } } }
YAML
AWSTemplateFormatVersion: 2010-09-09 Description: Creates a DataSync task that uses Enhanced mode Resources: Task: Type: AWS::DataSync::Task Properties: SourceLocationArn: arn:aws:datasync:us-east-2:111222333444:location/loc-1111aaaa2222bbbb3 DestinationLocationArn: arn:aws:datasync:us-east-2:111222333444:location/loc-0000zzzz1111yyyy2 Name: My-Enhanced-mode-task TaskMode: ENHANCED Options: TransferMode: CHANGED VerifyMode: ONLY_FILES_TRANSFERRED ObjectTags: PRESERVE LogLevel: TRANSFER
Creating a Basic mode task
The following examples create a Basic mode task. For more information, see Choosing a task mode for your data transfer.
JSON
{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Creates a DataSync task that uses Basic mode", "Resources": { "Task": { "Type": "AWS::DataSync::Task", "Properties": { "SourceLocationArn": "arn:aws:datasync:us-east-2:111222333444:location/loc-1111aaaa2222bbbb3", "DestinationLocationArn": "arn:aws:datasync:us-east-2:111222333444:location/loc-0000zzzz1111yyyy2", "Name": "My-Basic-mode-task", "TaskMode": "BASIC", "Options": { "TransferMode": "CHANGED", "VerifyMode": "POINT_IN_TIME_CONSISTENT", "LogLevel": "TRANSFER" }, "CloudWatchLogGroupArn": "arn:aws:logs:us-east-2:111222333444:log-group:/my-log-group-name:*" } } } }
YAML
AWSTemplateFormatVersion: 2010-09-09 Description: Creates a DataSync task that uses Basic mode Resources: Task: Type: AWS::DataSync::Task Properties: SourceLocationArn: arn:aws:datasync:us-east-2:111222333444:location/loc-1111aaaa2222bbbb3 DestinationLocationArn: arn:aws:datasync:us-east-2:111222333444:location/loc-0000zzzz1111yyyy2 Name: My-Basic-mode-task TaskMode: BASIC Options: TransferMode: CHANGED VerifyMode: POINT_IN_TIME_CONSISTENT LogLevel: TRANSFER CloudWatchLogGroupArn: arn:aws:logs:us-east-2:111222333444:log-group:/my-log-group-name:*