UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

171 lines 6.27 kB
"use strict"; // *** 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 * * ### Identity Schema * * #### Required * * - `arn` (String) Amazon Resource Name (ARN) of the DataSync task. * * Using `pulumi import`, import `aws_datasync_task` using the DataSync Task Amazon Resource Name (ARN). For example: * * console * * % pulumi import aws_datasync_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, { ...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?.arn; resourceInputs["cloudwatchLogGroupArn"] = state?.cloudwatchLogGroupArn; resourceInputs["destinationLocationArn"] = state?.destinationLocationArn; resourceInputs["excludes"] = state?.excludes; resourceInputs["includes"] = state?.includes; resourceInputs["name"] = state?.name; resourceInputs["options"] = state?.options; resourceInputs["region"] = state?.region; resourceInputs["schedule"] = state?.schedule; resourceInputs["sourceLocationArn"] = state?.sourceLocationArn; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["taskMode"] = state?.taskMode; resourceInputs["taskReportConfig"] = state?.taskReportConfig; } else { const args = argsOrState; if (args?.destinationLocationArn === undefined && !opts.urn) { throw new Error("Missing required property 'destinationLocationArn'"); } if (args?.sourceLocationArn === undefined && !opts.urn) { throw new Error("Missing required property 'sourceLocationArn'"); } resourceInputs["cloudwatchLogGroupArn"] = args?.cloudwatchLogGroupArn; resourceInputs["destinationLocationArn"] = args?.destinationLocationArn; resourceInputs["excludes"] = args?.excludes; resourceInputs["includes"] = args?.includes; resourceInputs["name"] = args?.name; resourceInputs["options"] = args?.options; resourceInputs["region"] = args?.region; resourceInputs["schedule"] = args?.schedule; resourceInputs["sourceLocationArn"] = args?.sourceLocationArn; resourceInputs["tags"] = args?.tags; resourceInputs["taskMode"] = args?.taskMode; resourceInputs["taskReportConfig"] = args?.taskReportConfig; 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