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, val taskMode: Output<String>? = null, val taskReportConfig: Output<TaskTaskReportConfigArgs>? = 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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.datasync.Task("example", {
destinationLocationArn: destination.arn,
name: "example",
sourceLocationArn: source.arn,
options: {
bytesPerSecond: -1,
},
});
import pulumi
import pulumi_aws as aws
example = aws.datasync.Task("example",
destination_location_arn=destination["arn"],
name="example",
source_location_arn=source["arn"],
options={
"bytes_per_second": -1,
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.DataSync.Task("example", new()
{
DestinationLocationArn = destination.Arn,
Name = "example",
SourceLocationArn = source.Arn,
Options = new Aws.DataSync.Inputs.TaskOptionsArgs
{
BytesPerSecond = -1,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datasync.NewTask(ctx, "example", &datasync.TaskArgs{
DestinationLocationArn: pulumi.Any(destination.Arn),
Name: pulumi.String("example"),
SourceLocationArn: pulumi.Any(source.Arn),
Options: &datasync.TaskOptionsArgs{
BytesPerSecond: pulumi.Int(-1),
},
})
if err != nil {
return err
}
return nil
})
}
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.TaskOptionsArgs;
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(destination.arn())
.name("example")
.sourceLocationArn(source.arn())
.options(TaskOptionsArgs.builder()
.bytesPerSecond(-1)
.build())
.build());
}
}
resources:
example:
type: aws:datasync:Task
properties:
destinationLocationArn: ${destination.arn}
name: example
sourceLocationArn: ${source.arn}
options:
bytesPerSecond: -1

With Scheduling

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.datasync.Task("example", {
destinationLocationArn: destination.arn,
name: "example",
sourceLocationArn: source.arn,
schedule: {
scheduleExpression: "cron(0 12 ? * SUN,WED *)",
},
});
import pulumi
import pulumi_aws as aws
example = aws.datasync.Task("example",
destination_location_arn=destination["arn"],
name="example",
source_location_arn=source["arn"],
schedule={
"schedule_expression": "cron(0 12 ? * SUN,WED *)",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.DataSync.Task("example", new()
{
DestinationLocationArn = destination.Arn,
Name = "example",
SourceLocationArn = source.Arn,
Schedule = new Aws.DataSync.Inputs.TaskScheduleArgs
{
ScheduleExpression = "cron(0 12 ? * SUN,WED *)",
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datasync.NewTask(ctx, "example", &datasync.TaskArgs{
DestinationLocationArn: pulumi.Any(destination.Arn),
Name: pulumi.String("example"),
SourceLocationArn: pulumi.Any(source.Arn),
Schedule: &datasync.TaskScheduleArgs{
ScheduleExpression: pulumi.String("cron(0 12 ? * SUN,WED *)"),
},
})
if err != nil {
return err
}
return nil
})
}
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(destination.arn())
.name("example")
.sourceLocationArn(source.arn())
.schedule(TaskScheduleArgs.builder()
.scheduleExpression("cron(0 12 ? * SUN,WED *)")
.build())
.build());
}
}
resources:
example:
type: aws:datasync:Task
properties:
destinationLocationArn: ${destination.arn}
name: example
sourceLocationArn: ${source.arn}
schedule:
scheduleExpression: cron(0 12 ? * SUN,WED *)

With Filtering

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.datasync.Task("example", {
destinationLocationArn: destination.arn,
name: "example",
sourceLocationArn: source.arn,
excludes: {
filterType: "SIMPLE_PATTERN",
value: "/folder1|/folder2",
},
includes: {
filterType: "SIMPLE_PATTERN",
value: "/folder1|/folder2",
},
});
import pulumi
import pulumi_aws as aws
example = aws.datasync.Task("example",
destination_location_arn=destination["arn"],
name="example",
source_location_arn=source["arn"],
excludes={
"filter_type": "SIMPLE_PATTERN",
"value": "/folder1|/folder2",
},
includes={
"filter_type": "SIMPLE_PATTERN",
"value": "/folder1|/folder2",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.DataSync.Task("example", new()
{
DestinationLocationArn = destination.Arn,
Name = "example",
SourceLocationArn = source.Arn,
Excludes = new Aws.DataSync.Inputs.TaskExcludesArgs
{
FilterType = "SIMPLE_PATTERN",
Value = "/folder1|/folder2",
},
Includes = new Aws.DataSync.Inputs.TaskIncludesArgs
{
FilterType = "SIMPLE_PATTERN",
Value = "/folder1|/folder2",
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datasync.NewTask(ctx, "example", &datasync.TaskArgs{
DestinationLocationArn: pulumi.Any(destination.Arn),
Name: pulumi.String("example"),
SourceLocationArn: pulumi.Any(source.Arn),
Excludes: &datasync.TaskExcludesArgs{
FilterType: pulumi.String("SIMPLE_PATTERN"),
Value: pulumi.String("/folder1|/folder2"),
},
Includes: &datasync.TaskIncludesArgs{
FilterType: pulumi.String("SIMPLE_PATTERN"),
Value: pulumi.String("/folder1|/folder2"),
},
})
if err != nil {
return err
}
return nil
})
}
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(destination.arn())
.name("example")
.sourceLocationArn(source.arn())
.excludes(TaskExcludesArgs.builder()
.filterType("SIMPLE_PATTERN")
.value("/folder1|/folder2")
.build())
.includes(TaskIncludesArgs.builder()
.filterType("SIMPLE_PATTERN")
.value("/folder1|/folder2")
.build())
.build());
}
}
resources:
example:
type: aws:datasync:Task
properties:
destinationLocationArn: ${destination.arn}
name: example
sourceLocationArn: ${source.arn}
excludes:
filterType: SIMPLE_PATTERN
value: /folder1|/folder2
includes:
filterType: SIMPLE_PATTERN
value: /folder1|/folder2

With Enhanced Task Mode

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.datasync.Task("example", {
destinationLocationArn: destination.arn,
name: "example",
sourceLocationArn: source.arn,
taskMode: "ENHANCED",
options: {
gid: "NONE",
posixPermissions: "NONE",
uid: "NONE",
verifyMode: "ONLY_FILES_TRANSFERRED",
},
});
import pulumi
import pulumi_aws as aws
example = aws.datasync.Task("example",
destination_location_arn=destination["arn"],
name="example",
source_location_arn=source["arn"],
task_mode="ENHANCED",
options={
"gid": "NONE",
"posix_permissions": "NONE",
"uid": "NONE",
"verify_mode": "ONLY_FILES_TRANSFERRED",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.DataSync.Task("example", new()
{
DestinationLocationArn = destination.Arn,
Name = "example",
SourceLocationArn = source.Arn,
TaskMode = "ENHANCED",
Options = new Aws.DataSync.Inputs.TaskOptionsArgs
{
Gid = "NONE",
PosixPermissions = "NONE",
Uid = "NONE",
VerifyMode = "ONLY_FILES_TRANSFERRED",
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datasync.NewTask(ctx, "example", &datasync.TaskArgs{
DestinationLocationArn: pulumi.Any(destination.Arn),
Name: pulumi.String("example"),
SourceLocationArn: pulumi.Any(source.Arn),
TaskMode: pulumi.String("ENHANCED"),
Options: &datasync.TaskOptionsArgs{
Gid: pulumi.String("NONE"),
PosixPermissions: pulumi.String("NONE"),
Uid: pulumi.String("NONE"),
VerifyMode: pulumi.String("ONLY_FILES_TRANSFERRED"),
},
})
if err != nil {
return err
}
return nil
})
}
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.TaskOptionsArgs;
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(destination.arn())
.name("example")
.sourceLocationArn(source.arn())
.taskMode("ENHANCED")
.options(TaskOptionsArgs.builder()
.gid("NONE")
.posixPermissions("NONE")
.uid("NONE")
.verifyMode("ONLY_FILES_TRANSFERRED")
.build())
.build());
}
}
resources:
example:
type: aws:datasync:Task
properties:
destinationLocationArn: ${destination.arn}
name: example
sourceLocationArn: ${source.arn}
taskMode: ENHANCED
options:
gid: NONE
posixPermissions: NONE
uid: NONE
verifyMode: ONLY_FILES_TRANSFERRED

Import

Using pulumi import, import aws_datasync_task using the DataSync Task Amazon Resource Name (ARN). For example:

$ 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, taskMode: Output<String>? = null, taskReportConfig: Output<TaskTaskReportConfigArgs>? = 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.

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

One of the following task modes for your data transfer:

Link copied to clipboard

Configuration block containing the configuration of a DataSync Task Report. See task_report_config below.

Functions

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