@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
153 lines • 8.61 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.ClusterInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an DocumentDB Cluster Resource Instance. A Cluster Instance Resource defines
* attributes that are specific to a single instance in a [DocumentDB Cluster][1].
*
* You do not designate a primary and subsequent replicas. Instead, you simply add DocumentDB
* Instances and DocumentDB manages the replication. You can use the [count][3]
* meta-parameter to make multiple instances and join them all to the same DocumentDB
* Cluster, or you may specify different Cluster Instance resources with various
* `instanceClass` sizes.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const _default = new aws.docdb.Cluster("default", {
* clusterIdentifier: "docdb-cluster-demo",
* availabilityZones: [
* "us-west-2a",
* "us-west-2b",
* "us-west-2c",
* ],
* masterUsername: "foo",
* masterPassword: "barbut8chars",
* });
* const clusterInstances: aws.docdb.ClusterInstance[] = [];
* for (const range = {value: 0}; range.value < 2; range.value++) {
* clusterInstances.push(new aws.docdb.ClusterInstance(`cluster_instances-${range.value}`, {
* identifier: `docdb-cluster-demo-${range.value}`,
* clusterIdentifier: _default.id,
* instanceClass: "db.r5.large",
* }));
* }
* ```
*
* ## Import
*
* Using `pulumi import`, import DocumentDB Cluster Instances using the `identifier`. For example:
*
* ```sh
* $ pulumi import aws:docdb/clusterInstance:ClusterInstance prod_instance_1 aurora-cluster-instance-1
* ```
*/
class ClusterInstance extends pulumi.CustomResource {
/**
* Get an existing ClusterInstance 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 ClusterInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ClusterInstance. 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'] === ClusterInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["applyImmediately"] = state ? state.applyImmediately : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["autoMinorVersionUpgrade"] = state ? state.autoMinorVersionUpgrade : undefined;
resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined;
resourceInputs["caCertIdentifier"] = state ? state.caCertIdentifier : undefined;
resourceInputs["clusterIdentifier"] = state ? state.clusterIdentifier : undefined;
resourceInputs["copyTagsToSnapshot"] = state ? state.copyTagsToSnapshot : undefined;
resourceInputs["dbSubnetGroupName"] = state ? state.dbSubnetGroupName : undefined;
resourceInputs["dbiResourceId"] = state ? state.dbiResourceId : undefined;
resourceInputs["enablePerformanceInsights"] = state ? state.enablePerformanceInsights : undefined;
resourceInputs["endpoint"] = state ? state.endpoint : undefined;
resourceInputs["engine"] = state ? state.engine : undefined;
resourceInputs["engineVersion"] = state ? state.engineVersion : undefined;
resourceInputs["identifier"] = state ? state.identifier : undefined;
resourceInputs["identifierPrefix"] = state ? state.identifierPrefix : undefined;
resourceInputs["instanceClass"] = state ? state.instanceClass : undefined;
resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined;
resourceInputs["performanceInsightsKmsKeyId"] = state ? state.performanceInsightsKmsKeyId : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["preferredBackupWindow"] = state ? state.preferredBackupWindow : undefined;
resourceInputs["preferredMaintenanceWindow"] = state ? state.preferredMaintenanceWindow : undefined;
resourceInputs["promotionTier"] = state ? state.promotionTier : undefined;
resourceInputs["publiclyAccessible"] = state ? state.publiclyAccessible : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["storageEncrypted"] = state ? state.storageEncrypted : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["writer"] = state ? state.writer : undefined;
}
else {
const args = argsOrState;
if ((!args || args.clusterIdentifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'clusterIdentifier'");
}
if ((!args || args.instanceClass === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceClass'");
}
resourceInputs["applyImmediately"] = args ? args.applyImmediately : undefined;
resourceInputs["autoMinorVersionUpgrade"] = args ? args.autoMinorVersionUpgrade : undefined;
resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined;
resourceInputs["caCertIdentifier"] = args ? args.caCertIdentifier : undefined;
resourceInputs["clusterIdentifier"] = args ? args.clusterIdentifier : undefined;
resourceInputs["copyTagsToSnapshot"] = args ? args.copyTagsToSnapshot : undefined;
resourceInputs["enablePerformanceInsights"] = args ? args.enablePerformanceInsights : undefined;
resourceInputs["engine"] = args ? args.engine : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["identifierPrefix"] = args ? args.identifierPrefix : undefined;
resourceInputs["instanceClass"] = args ? args.instanceClass : undefined;
resourceInputs["performanceInsightsKmsKeyId"] = args ? args.performanceInsightsKmsKeyId : undefined;
resourceInputs["preferredMaintenanceWindow"] = args ? args.preferredMaintenanceWindow : undefined;
resourceInputs["promotionTier"] = args ? args.promotionTier : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["dbSubnetGroupName"] = undefined /*out*/;
resourceInputs["dbiResourceId"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["engineVersion"] = undefined /*out*/;
resourceInputs["kmsKeyId"] = undefined /*out*/;
resourceInputs["port"] = undefined /*out*/;
resourceInputs["preferredBackupWindow"] = undefined /*out*/;
resourceInputs["publiclyAccessible"] = undefined /*out*/;
resourceInputs["storageEncrypted"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["writer"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ClusterInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.ClusterInstance = ClusterInstance;
/** @internal */
ClusterInstance.__pulumiType = 'aws:docdb/clusterInstance:ClusterInstance';
//# sourceMappingURL=clusterInstance.js.map