@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
132 lines • 6.34 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.ReplicationConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a DMS Serverless replication config resource.
*
* > **NOTE:** Changing most arguments will stop the replication if it is running. You can set `startReplication` to resume the replication afterwards.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const name = new aws.dms.ReplicationConfig("name", {
* replicationConfigIdentifier: "test-dms-serverless-replication-tf",
* resourceIdentifier: "test-dms-serverless-replication-tf",
* replicationType: "cdc",
* sourceEndpointArn: source.endpointArn,
* targetEndpointArn: target.endpointArn,
* tableMappings: ` {
* "rules":[{"rule-type":"selection","rule-id":"1","rule-name":"1","rule-action":"include","object-locator":{"schema-name":"%%","table-name":"%%"}}]
* }
* `,
* startReplication: true,
* computeConfig: {
* replicationSubnetGroupId: _default.replicationSubnetGroupId,
* maxCapacityUnits: 64,
* minCapacityUnits: 2,
* preferredMaintenanceWindow: "sun:23:45-mon:00:30",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import a replication config using the `arn`. For example:
*
* ```sh
* $ pulumi import aws:dms/replicationConfig:ReplicationConfig example arn:aws:dms:us-east-1:123456789012:replication-config:UX6OL6MHMMJKFFOXE3H7LLJCMEKBDUG4ZV7DRSI
* ```
*/
class ReplicationConfig extends pulumi.CustomResource {
/**
* Get an existing ReplicationConfig 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 ReplicationConfig(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ReplicationConfig. 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'] === ReplicationConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["computeConfig"] = state?.computeConfig;
resourceInputs["region"] = state?.region;
resourceInputs["replicationConfigIdentifier"] = state?.replicationConfigIdentifier;
resourceInputs["replicationSettings"] = state?.replicationSettings;
resourceInputs["replicationType"] = state?.replicationType;
resourceInputs["resourceIdentifier"] = state?.resourceIdentifier;
resourceInputs["sourceEndpointArn"] = state?.sourceEndpointArn;
resourceInputs["startReplication"] = state?.startReplication;
resourceInputs["supplementalSettings"] = state?.supplementalSettings;
resourceInputs["tableMappings"] = state?.tableMappings;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["targetEndpointArn"] = state?.targetEndpointArn;
}
else {
const args = argsOrState;
if (args?.computeConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'computeConfig'");
}
if (args?.replicationConfigIdentifier === undefined && !opts.urn) {
throw new Error("Missing required property 'replicationConfigIdentifier'");
}
if (args?.replicationType === undefined && !opts.urn) {
throw new Error("Missing required property 'replicationType'");
}
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["computeConfig"] = args?.computeConfig;
resourceInputs["region"] = args?.region;
resourceInputs["replicationConfigIdentifier"] = args?.replicationConfigIdentifier;
resourceInputs["replicationSettings"] = args?.replicationSettings;
resourceInputs["replicationType"] = args?.replicationType;
resourceInputs["resourceIdentifier"] = args?.resourceIdentifier;
resourceInputs["sourceEndpointArn"] = args?.sourceEndpointArn;
resourceInputs["startReplication"] = args?.startReplication;
resourceInputs["supplementalSettings"] = args?.supplementalSettings;
resourceInputs["tableMappings"] = args?.tableMappings;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetEndpointArn"] = args?.targetEndpointArn;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ReplicationConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.ReplicationConfig = ReplicationConfig;
/** @internal */
ReplicationConfig.__pulumiType = 'aws:dms/replicationConfig:ReplicationConfig';
//# sourceMappingURL=replicationConfig.js.map
;