Task Args
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 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,
},
});Content copied to clipboard
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=aws.datasync.TaskOptionsArgs(
bytes_per_second=-1,
))Content copied to clipboard
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,
},
});
});Content copied to clipboard
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: -1,
},
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
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 *)",
},
});Content copied to clipboard
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=aws.datasync.TaskScheduleArgs(
schedule_expression="cron(0 12 ? * SUN,WED *)",
))Content copied to clipboard
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 *)",
},
});
});Content copied to clipboard
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
})
}Content copied to clipboard
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());
}
}Content copied to clipboard
resources:
example:
type: aws:datasync:Task
properties:
destinationLocationArn: ${destination.arn}
name: example
sourceLocationArn: ${source.arn}
schedule:
scheduleExpression: cron(0 12 ? * SUN,WED *)Content copied to clipboard
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",
},
});Content copied to clipboard
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=aws.datasync.TaskExcludesArgs(
filter_type="SIMPLE_PATTERN",
value="/folder1|/folder2",
),
includes=aws.datasync.TaskIncludesArgs(
filter_type="SIMPLE_PATTERN",
value="/folder1|/folder2",
))Content copied to clipboard
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",
},
});
});Content copied to clipboard
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
})
}Content copied to clipboard
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());
}
}Content copied to clipboard
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|/folder2Content copied to clipboard
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-12345678901234567Content copied to clipboard
Constructors
Link copied to clipboard
fun TaskArgs(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, taskReportConfig: Output<TaskTaskReportConfigArgs>? = null)