UNPKG

@pulumi/aws

Version:

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

132 lines 6.58 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, { ...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?.cdcStartPosition; resourceInputs["cdcStartTime"] = state?.cdcStartTime; resourceInputs["migrationType"] = state?.migrationType; resourceInputs["region"] = state?.region; resourceInputs["replicationInstanceArn"] = state?.replicationInstanceArn; resourceInputs["replicationTaskArn"] = state?.replicationTaskArn; resourceInputs["replicationTaskId"] = state?.replicationTaskId; resourceInputs["replicationTaskSettings"] = state?.replicationTaskSettings; resourceInputs["resourceIdentifier"] = state?.resourceIdentifier; resourceInputs["sourceEndpointArn"] = state?.sourceEndpointArn; resourceInputs["startReplicationTask"] = state?.startReplicationTask; resourceInputs["status"] = state?.status; resourceInputs["tableMappings"] = state?.tableMappings; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["targetEndpointArn"] = state?.targetEndpointArn; } else { const args = argsOrState; if (args?.migrationType === undefined && !opts.urn) { throw new Error("Missing required property 'migrationType'"); } if (args?.replicationInstanceArn === undefined && !opts.urn) { throw new Error("Missing required property 'replicationInstanceArn'"); } if (args?.replicationTaskId === undefined && !opts.urn) { throw new Error("Missing required property 'replicationTaskId'"); } if (args?.sourceEndpointArn === undefined && !opts.urn) { throw new Error("Missing required property 'sourceEndpointArn'"); } if (args?.tableMappings === undefined && !opts.urn) { throw new Error("Missing required property 'tableMappings'"); } if (args?.targetEndpointArn === undefined && !opts.urn) { throw new Error("Missing required property 'targetEndpointArn'"); } resourceInputs["cdcStartPosition"] = args?.cdcStartPosition; resourceInputs["cdcStartTime"] = args?.cdcStartTime; resourceInputs["migrationType"] = args?.migrationType; resourceInputs["region"] = args?.region; resourceInputs["replicationInstanceArn"] = args?.replicationInstanceArn; resourceInputs["replicationTaskId"] = args?.replicationTaskId; resourceInputs["replicationTaskSettings"] = args?.replicationTaskSettings; resourceInputs["resourceIdentifier"] = args?.resourceIdentifier; resourceInputs["sourceEndpointArn"] = args?.sourceEndpointArn; resourceInputs["startReplicationTask"] = args?.startReplicationTask; resourceInputs["tableMappings"] = args?.tableMappings; resourceInputs["tags"] = args?.tags; resourceInputs["targetEndpointArn"] = args?.targetEndpointArn; 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