@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
103 lines • 4.23 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.ClusterPeering = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an Amazon Aurora DSQL Cluster Peering.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example1 = new aws.dsql.Cluster("example_1", {multiRegionProperties: {
* witnessRegion: "us-west-2",
* }});
* const example2 = new aws.dsql.Cluster("example_2", {multiRegionProperties: {
* witnessRegion: "us-west-2",
* }});
* const example1ClusterPeering = new aws.dsql.ClusterPeering("example_1", {
* identifier: example1.identifier,
* clusters: [example2.arn],
* witnessRegion: example1.multiRegionProperties.apply(multiRegionProperties => multiRegionProperties?.witnessRegion),
* });
* const example2ClusterPeering = new aws.dsql.ClusterPeering("example_2", {
* identifier: example2.identifier,
* clusters: [example1.arn],
* witnessRegion: example2.multiRegionProperties.apply(multiRegionProperties => multiRegionProperties?.witnessRegion),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import DSQL Cluster Peering using the `identifier`. For example:
*
* ```sh
* $ pulumi import aws:dsql/clusterPeering:ClusterPeering example cluster-id-12345678
* ```
*/
class ClusterPeering extends pulumi.CustomResource {
/**
* Get an existing ClusterPeering 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 ClusterPeering(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ClusterPeering. 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'] === ClusterPeering.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clusters"] = state?.clusters;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["region"] = state?.region;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["witnessRegion"] = state?.witnessRegion;
}
else {
const args = argsOrState;
if (args?.clusters === undefined && !opts.urn) {
throw new Error("Missing required property 'clusters'");
}
if (args?.identifier === undefined && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if (args?.witnessRegion === undefined && !opts.urn) {
throw new Error("Missing required property 'witnessRegion'");
}
resourceInputs["clusters"] = args?.clusters;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["region"] = args?.region;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["witnessRegion"] = args?.witnessRegion;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ClusterPeering.__pulumiType, name, resourceInputs, opts);
}
}
exports.ClusterPeering = ClusterPeering;
/** @internal */
ClusterPeering.__pulumiType = 'aws:dsql/clusterPeering:ClusterPeering';
//# sourceMappingURL=clusterPeering.js.map
;