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, Amazon DataSync populates them with service defaults.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::DataSync::Task", "Properties" : { "CloudWatchLogGroupArn" :
String
, "DestinationLocationArn" :String
, "Excludes" :[ FilterRule, ... ]
, "Includes" :[ FilterRule, ... ]
, "Name" :String
, "Options" :Options
, "Schedule" :TaskSchedule
, "SourceLocationArn" :String
, "Tags" :[ Tag, ... ]
} }
YAML
Type: AWS::DataSync::Task Properties: CloudWatchLogGroupArn:
String
DestinationLocationArn:String
Excludes:- FilterRule
Includes:- FilterRule
Name:String
Options:Options
Schedule:TaskSchedule
SourceLocationArn:String
Tags:- Tag
Properties
CloudWatchLogGroupArn
-
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 Amazon 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
DestinationLocationArn
-
The Amazon Resource Name (ARN) of an Amazon storage resource's location.
Required: Yes
Type: String
Update requires: Replacement
Excludes
-
Specifies a list of filter rules that exclude specific data during your transfer. For more information and examples, see Filtering data transferred by DataSync.
Required: No
Type: List of FilterRule
Maximum:
1
Update requires: No interruption
Includes
-
Specifies a list of filter rules that include specific data during your transfer. For more information and examples, see Filtering data transferred by DataSync.
Required: No
Type: List of FilterRule
Maximum:
1
Update requires: No interruption
Name
-
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
Options
-
Specifies the configuration options for a task. Some options include preserving file or object metadata and verifying data integrity.
You can also override these options before starting an individual run of a task (also known as a task execution). For more information, see StartTaskExecution.
Required: No
Type: Options
Update requires: No interruption
Schedule
-
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 Scheduling your task.
Required: No
Type: TaskSchedule
Update requires: No interruption
SourceLocationArn
-
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
Tags
-
Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task.
Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.
Required: No
Type: List of Tag
Maximum:
50
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.
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