Task

class Task : KotlinCustomResource

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 resource.

Example Usage

With Scheduling

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.datasync.Task;
import com.pulumi.aws.datasync.TaskArgs;
import com.pulumi.aws.datasync.inputs.TaskScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Task("example", TaskArgs.builder()
.destinationLocationArn(aws_datasync_location_s3.destination().arn())
.sourceLocationArn(aws_datasync_location_nfs.source().arn())
.schedule(TaskScheduleArgs.builder()
.scheduleExpression("cron(0 12 ? * SUN,WED *)")
.build())
.build());
}
}

With Filtering

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.datasync.Task;
import com.pulumi.aws.datasync.TaskArgs;
import com.pulumi.aws.datasync.inputs.TaskExcludesArgs;
import com.pulumi.aws.datasync.inputs.TaskIncludesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Task("example", TaskArgs.builder()
.destinationLocationArn(aws_datasync_location_s3.destination().arn())
.sourceLocationArn(aws_datasync_location_nfs.source().arn())
.excludes(TaskExcludesArgs.builder()
.filterType("SIMPLE_PATTERN")
.value("/folder1|/folder2")
.build())
.includes(TaskIncludesArgs.builder()
.filterType("SIMPLE_PATTERN")
.value("/folder1|/folder2")
.build())
.build());
}
}

Import

aws_datasync_task can be imported by using the DataSync Task Amazon Resource Name (ARN), e.g.,

$ pulumi import aws:datasync/task:Task example arn:aws:datasync:us-east-1:123456789012:task/task-12345678901234567

Properties

Link copied to clipboard
val arn: Output<String>

Amazon Resource Name (ARN) of the DataSync Task.

Link copied to clipboard

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

Link copied to clipboard

Amazon Resource Name (ARN) of destination DataSync Location.

Link copied to clipboard
val excludes: Output<TaskExcludes>?

Filter rules that determines which files to exclude from a task.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val includes: Output<TaskIncludes>?

Filter rules that determines which files to include in a task.

Link copied to clipboard
val name: Output<String>

Name of the DataSync Task.

Link copied to clipboard
val options: Output<TaskOptions>?

Configuration block containing option that controls the default behavior when you start an execution of this DataSync Task. For each individual task execution, you can override these options by specifying an overriding configuration in those executions.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val schedule: Output<TaskSchedule>?

Specifies a schedule used to periodically transfer files from a source to a destination location.

Link copied to clipboard

Amazon Resource Name (ARN) of source DataSync Location.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Key-value pairs of resource tags to assign to the DataSync Task. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>