@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
165 lines • 6.69 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Task = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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
*
* ```typescript
* 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,
* },
* });
* ```
*
* ### With Scheduling
*
* ```typescript
* 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 *)",
* },
* });
* ```
*
* ### With Filtering
*
* ```typescript
* 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",
* },
* });
* ```
*
* ### With Enhanced Task Mode
*
* ```typescript
* 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
*
* Using `pulumi import`, import `aws_datasync_task` using the DataSync Task Amazon Resource Name (ARN). For example:
*
* ```sh
* $ pulumi import aws:datasync/task:Task example arn:aws:datasync:us-east-1:123456789012:task/task-12345678901234567
* ```
*/
class Task extends pulumi.CustomResource {
/**
* Get an existing Task resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Task(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Task. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Task.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["cloudwatchLogGroupArn"] = state ? state.cloudwatchLogGroupArn : undefined;
resourceInputs["destinationLocationArn"] = state ? state.destinationLocationArn : undefined;
resourceInputs["excludes"] = state ? state.excludes : undefined;
resourceInputs["includes"] = state ? state.includes : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["options"] = state ? state.options : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["schedule"] = state ? state.schedule : undefined;
resourceInputs["sourceLocationArn"] = state ? state.sourceLocationArn : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["taskMode"] = state ? state.taskMode : undefined;
resourceInputs["taskReportConfig"] = state ? state.taskReportConfig : undefined;
}
else {
const args = argsOrState;
if ((!args || args.destinationLocationArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'destinationLocationArn'");
}
if ((!args || args.sourceLocationArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'sourceLocationArn'");
}
resourceInputs["cloudwatchLogGroupArn"] = args ? args.cloudwatchLogGroupArn : undefined;
resourceInputs["destinationLocationArn"] = args ? args.destinationLocationArn : undefined;
resourceInputs["excludes"] = args ? args.excludes : undefined;
resourceInputs["includes"] = args ? args.includes : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["options"] = args ? args.options : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["schedule"] = args ? args.schedule : undefined;
resourceInputs["sourceLocationArn"] = args ? args.sourceLocationArn : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["taskMode"] = args ? args.taskMode : undefined;
resourceInputs["taskReportConfig"] = args ? args.taskReportConfig : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Task.__pulumiType, name, resourceInputs, opts);
}
}
exports.Task = Task;
/** @internal */
Task.__pulumiType = 'aws:datasync/task:Task';
//# sourceMappingURL=task.js.map