UNPKG

@pulumi/aws

Version:

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

132 lines 7.21 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.ReplicationTask = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a DMS (Data Migration Service) replication task resource. DMS replication tasks can be created, updated, deleted, and imported. * * > **NOTE:** Changing most arguments will stop the task if it is running. You can set `startReplicationTask` to resume the task afterwards. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * // Create a new replication task * const test = new aws.dms.ReplicationTask("test", { * cdcStartTime: "1993-05-21T05:50:00Z", * migrationType: "full-load", * replicationInstanceArn: test_dms_replication_instance_tf.replicationInstanceArn, * replicationTaskId: "test-dms-replication-task-tf", * replicationTaskSettings: "...", * sourceEndpointArn: test_dms_source_endpoint_tf.endpointArn, * tableMappings: "{\"rules\":[{\"rule-type\":\"selection\",\"rule-id\":\"1\",\"rule-name\":\"1\",\"object-locator\":{\"schema-name\":\"%\",\"table-name\":\"%\"},\"rule-action\":\"include\"}]}", * tags: { * Name: "test", * }, * targetEndpointArn: test_dms_target_endpoint_tf.endpointArn, * }); * ``` * * ## Import * * Using `pulumi import`, import replication tasks using the `replication_task_id`. For example: * * ```sh * $ pulumi import aws:dms/replicationTask:ReplicationTask test test-dms-replication-task-tf * ``` */ class ReplicationTask extends pulumi.CustomResource { /** * Get an existing ReplicationTask 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 ReplicationTask(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ReplicationTask. 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'] === ReplicationTask.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cdcStartPosition"] = state ? state.cdcStartPosition : undefined; resourceInputs["cdcStartTime"] = state ? state.cdcStartTime : undefined; resourceInputs["migrationType"] = state ? state.migrationType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["replicationInstanceArn"] = state ? state.replicationInstanceArn : undefined; resourceInputs["replicationTaskArn"] = state ? state.replicationTaskArn : undefined; resourceInputs["replicationTaskId"] = state ? state.replicationTaskId : undefined; resourceInputs["replicationTaskSettings"] = state ? state.replicationTaskSettings : undefined; resourceInputs["resourceIdentifier"] = state ? state.resourceIdentifier : undefined; resourceInputs["sourceEndpointArn"] = state ? state.sourceEndpointArn : undefined; resourceInputs["startReplicationTask"] = state ? state.startReplicationTask : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tableMappings"] = state ? state.tableMappings : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["targetEndpointArn"] = state ? state.targetEndpointArn : undefined; } else { const args = argsOrState; if ((!args || args.migrationType === undefined) && !opts.urn) { throw new Error("Missing required property 'migrationType'"); } if ((!args || args.replicationInstanceArn === undefined) && !opts.urn) { throw new Error("Missing required property 'replicationInstanceArn'"); } if ((!args || args.replicationTaskId === undefined) && !opts.urn) { throw new Error("Missing required property 'replicationTaskId'"); } if ((!args || args.sourceEndpointArn === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceEndpointArn'"); } if ((!args || args.tableMappings === undefined) && !opts.urn) { throw new Error("Missing required property 'tableMappings'"); } if ((!args || args.targetEndpointArn === undefined) && !opts.urn) { throw new Error("Missing required property 'targetEndpointArn'"); } resourceInputs["cdcStartPosition"] = args ? args.cdcStartPosition : undefined; resourceInputs["cdcStartTime"] = args ? args.cdcStartTime : undefined; resourceInputs["migrationType"] = args ? args.migrationType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["replicationInstanceArn"] = args ? args.replicationInstanceArn : undefined; resourceInputs["replicationTaskId"] = args ? args.replicationTaskId : undefined; resourceInputs["replicationTaskSettings"] = args ? args.replicationTaskSettings : undefined; resourceInputs["resourceIdentifier"] = args ? args.resourceIdentifier : undefined; resourceInputs["sourceEndpointArn"] = args ? args.sourceEndpointArn : undefined; resourceInputs["startReplicationTask"] = args ? args.startReplicationTask : undefined; resourceInputs["tableMappings"] = args ? args.tableMappings : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["targetEndpointArn"] = args ? args.targetEndpointArn : undefined; resourceInputs["replicationTaskArn"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ReplicationTask.__pulumiType, name, resourceInputs, opts); } } exports.ReplicationTask = ReplicationTask; /** @internal */ ReplicationTask.__pulumiType = 'aws:dms/replicationTask:ReplicationTask'; //# sourceMappingURL=replicationTask.js.map