@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
151 lines • 6.27 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.ClusterEndpoint = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an RDS Aurora Cluster Custom Endpoint.
* You can refer to the [User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Overview.Endpoints.html#Aurora.Endpoints.Cluster).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const _default = new aws.rds.Cluster("default", {
* clusterIdentifier: "aurora-cluster-demo",
* availabilityZones: [
* "us-west-2a",
* "us-west-2b",
* "us-west-2c",
* ],
* databaseName: "mydb",
* masterUsername: "foo",
* masterPassword: "bar",
* backupRetentionPeriod: 5,
* preferredBackupWindow: "07:00-09:00",
* });
* const test1 = new aws.rds.ClusterInstance("test1", {
* applyImmediately: true,
* clusterIdentifier: _default.id,
* identifier: "test1",
* instanceClass: aws.rds.InstanceType.T2_Small,
* engine: _default.engine.apply((x) => aws.rds.EngineType[x]),
* engineVersion: _default.engineVersion,
* });
* const test2 = new aws.rds.ClusterInstance("test2", {
* applyImmediately: true,
* clusterIdentifier: _default.id,
* identifier: "test2",
* instanceClass: aws.rds.InstanceType.T2_Small,
* engine: _default.engine.apply((x) => aws.rds.EngineType[x]),
* engineVersion: _default.engineVersion,
* });
* const test3 = new aws.rds.ClusterInstance("test3", {
* applyImmediately: true,
* clusterIdentifier: _default.id,
* identifier: "test3",
* instanceClass: aws.rds.InstanceType.T2_Small,
* engine: _default.engine.apply((x) => aws.rds.EngineType[x]),
* engineVersion: _default.engineVersion,
* });
* const eligible = new aws.rds.ClusterEndpoint("eligible", {
* clusterIdentifier: _default.id,
* clusterEndpointIdentifier: "reader",
* customEndpointType: "READER",
* excludedMembers: [
* test1.id,
* test2.id,
* ],
* });
* const static = new aws.rds.ClusterEndpoint("static", {
* clusterIdentifier: _default.id,
* clusterEndpointIdentifier: "static",
* customEndpointType: "READER",
* staticMembers: [
* test1.id,
* test3.id,
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import RDS Clusters Endpoint using the `cluster_endpoint_identifier`. For example:
*
* ```sh
* $ pulumi import aws:rds/clusterEndpoint:ClusterEndpoint custom_reader aurora-prod-cluster-custom-reader
* ```
*/
class ClusterEndpoint extends pulumi.CustomResource {
/**
* Get an existing ClusterEndpoint 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 ClusterEndpoint(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ClusterEndpoint. 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'] === ClusterEndpoint.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["clusterEndpointIdentifier"] = state?.clusterEndpointIdentifier;
resourceInputs["clusterIdentifier"] = state?.clusterIdentifier;
resourceInputs["customEndpointType"] = state?.customEndpointType;
resourceInputs["endpoint"] = state?.endpoint;
resourceInputs["excludedMembers"] = state?.excludedMembers;
resourceInputs["region"] = state?.region;
resourceInputs["staticMembers"] = state?.staticMembers;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.clusterEndpointIdentifier === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterEndpointIdentifier'");
}
if (args?.clusterIdentifier === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterIdentifier'");
}
if (args?.customEndpointType === undefined && !opts.urn) {
throw new Error("Missing required property 'customEndpointType'");
}
resourceInputs["clusterEndpointIdentifier"] = args?.clusterEndpointIdentifier;
resourceInputs["clusterIdentifier"] = args?.clusterIdentifier;
resourceInputs["customEndpointType"] = args?.customEndpointType;
resourceInputs["excludedMembers"] = args?.excludedMembers;
resourceInputs["region"] = args?.region;
resourceInputs["staticMembers"] = args?.staticMembers;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ClusterEndpoint.__pulumiType, name, resourceInputs, opts);
}
}
exports.ClusterEndpoint = ClusterEndpoint;
/** @internal */
ClusterEndpoint.__pulumiType = 'aws:rds/clusterEndpoint:ClusterEndpoint';
//# sourceMappingURL=clusterEndpoint.js.map
;