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, ... ]
, "Name" :String
, "Options" :Options
, "Schedule" :TaskSchedule
, "SourceLocationArn" :String
, "Tags" :[ Tag, ... ]
} }
YAML
Type: AWS::DataSync::Task Properties: CloudWatchLogGroupArn:
String
DestinationLocationArn:String
Excludes:- 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 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
DestinationLocationArn
-
Not currently supported by AWS CloudFormation.
Required: Yes
Type: String
Update requires: Replacement
Excludes
-
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
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
-
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
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 task-scheduling.
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
-
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
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:location/loc-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
-
Not currently supported by AWS CloudFormation.
ErrorCode
-
Errors that AWS DataSync encountered during execution of the task. You can use this error code to help troubleshoot issues.
ErrorDetail
-
Detailed description of an error that was encountered during the task execution. You can use this information to help troubleshoot issues.
Status
-
The status of the task that was described.
TaskArn
-
The Amazon Resource Name (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": { "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" } } }
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