TaskArgs

data class TaskArgs(val cloudwatchLogGroupArn: Output<String>? = null, val destinationLocationArn: Output<String>? = null, val excludes: Output<TaskExcludesArgs>? = null, val includes: Output<TaskIncludesArgs>? = null, val name: Output<String>? = null, val options: Output<TaskOptionsArgs>? = null, val schedule: Output<TaskScheduleArgs>? = null, val sourceLocationArn: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<TaskArgs>

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

Constructors

Link copied to clipboard
constructor(cloudwatchLogGroupArn: Output<String>? = null, destinationLocationArn: Output<String>? = null, excludes: Output<TaskExcludesArgs>? = null, includes: Output<TaskIncludesArgs>? = null, name: Output<String>? = null, options: Output<TaskOptionsArgs>? = null, schedule: Output<TaskScheduleArgs>? = null, sourceLocationArn: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val cloudwatchLogGroupArn: Output<String>? = null

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
val destinationLocationArn: Output<String>? = null

Amazon Resource Name (ARN) of destination DataSync Location.

Link copied to clipboard
val excludes: Output<TaskExcludesArgs>? = null

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

Link copied to clipboard
val includes: Output<TaskIncludesArgs>? = null

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

Link copied to clipboard
val name: Output<String>? = null

Name of the DataSync Task.

Link copied to clipboard
val options: Output<TaskOptionsArgs>? = null

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 schedule: Output<TaskScheduleArgs>? = null

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

Link copied to clipboard
val sourceLocationArn: Output<String>? = null

Amazon Resource Name (ARN) of source DataSync Location.

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

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.

Functions

Link copied to clipboard
open override fun toJava(): TaskArgs