AWS DataSync Task
This page shows how to write Terraform and CloudFormation for DataSync Task and write them securely.
aws_datasync_task (Terraform)
The Task in DataSync can be configured in Terraform with the resource name aws_datasync_task
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_datasync_task" "backup-create" {
destination_location_arn = aws_datasync_location_s3.backup.arn
name = "backup-create"
source_location_arn = aws_datasync_location_efs.minecraft_ondemand_efs.arn
schedule {
resource "aws_datasync_task" "example" {
destination_location_arn = aws_datasync_location_s3.destination.arn
name = "example"
source_location_arn = aws_datasync_location_nfs.source.arn
options {
resource "aws_datasync_task" "efs_datasync_task" {
destination_location_arn = aws_datasync_location_efs.efsdestination.arn
name = "ReplicationEFS"
source_location_arn = aws_datasync_location_efs.efs_source.arn
schedule {
resource "aws_datasync_task" "pracmig_datasync_task" {
destination_location_arn = aws_datasync_location_s3.destination_location.arn
name = "pracmig"
source_location_arn = aws_datasync_location_s3.source_location.arn
}
resource "aws_datasync_task" "this" {
cloudwatch_log_group_arn = var.cloudwatch_log_group_arn
destination_location_arn = var.destination_location_arn
name = var.name
source_location_arn = var.source_location_arn
tags = var.tags
Parameters
-
arn
optional computed - string -
cloudwatch_log_group_arn
optional - string -
destination_location_arn
required - string -
id
optional computed - string -
name
optional - string -
source_location_arn
required - string -
tags
optional - map from string to string -
options
list block-
atime
optional - string -
bytes_per_second
optional - number -
gid
optional - string -
mtime
optional - string -
posix_permissions
optional - string -
preserve_deleted_files
optional - string -
preserve_devices
optional - string -
uid
optional - string -
verify_mode
optional - string
-
-
timeouts
single block-
create
optional - string
-
Explanation in Terraform Registry
Manages an AWS DataSync Task, which represents a configuration for synchronization. Starting an execution of these DataSync Tasks (actually synchronizing files) is performed outside of this Terraform resource.
AWS::DataSync::Task (CloudFormation)
The Task in DataSync can be configured in CloudFormation with the resource name AWS::DataSync::Task
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
Excludes
optional - List of FilterRule -
Includes
optional - List of FilterRule -
Tags
optional - List of Tag -
CloudWatchLogGroupArn
optional - String -
DestinationLocationArn
required - String -
Name
optional - String -
Options
optional - Options -
Schedule
optional - TaskSchedule -
SourceLocationArn
required - String
Explanation in CloudFormation Registry
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.
Frequently asked questions
What is AWS DataSync Task?
AWS DataSync Task is a resource for DataSync of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS DataSync Task?
For Terraform, the JKolios/minecraft-ondemand-terraform, shaikis/terraform-aws-datasync and fabiodsilva/terraform-efs-datasync-awsbackup source code examples are useful. See the Terraform Example section for further details.