UNPKG

@pulumi/aws

Version:

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

153 lines 7.74 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.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, { ...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?.applyImmediately; resourceInputs["arn"] = state?.arn; resourceInputs["autoMinorVersionUpgrade"] = state?.autoMinorVersionUpgrade; resourceInputs["availabilityZone"] = state?.availabilityZone; resourceInputs["caCertIdentifier"] = state?.caCertIdentifier; resourceInputs["clusterIdentifier"] = state?.clusterIdentifier; resourceInputs["copyTagsToSnapshot"] = state?.copyTagsToSnapshot; resourceInputs["dbSubnetGroupName"] = state?.dbSubnetGroupName; resourceInputs["dbiResourceId"] = state?.dbiResourceId; resourceInputs["enablePerformanceInsights"] = state?.enablePerformanceInsights; resourceInputs["endpoint"] = state?.endpoint; resourceInputs["engine"] = state?.engine; resourceInputs["engineVersion"] = state?.engineVersion; resourceInputs["identifier"] = state?.identifier; resourceInputs["identifierPrefix"] = state?.identifierPrefix; resourceInputs["instanceClass"] = state?.instanceClass; resourceInputs["kmsKeyId"] = state?.kmsKeyId; resourceInputs["performanceInsightsKmsKeyId"] = state?.performanceInsightsKmsKeyId; resourceInputs["port"] = state?.port; resourceInputs["preferredBackupWindow"] = state?.preferredBackupWindow; resourceInputs["preferredMaintenanceWindow"] = state?.preferredMaintenanceWindow; resourceInputs["promotionTier"] = state?.promotionTier; resourceInputs["publiclyAccessible"] = state?.publiclyAccessible; resourceInputs["region"] = state?.region; resourceInputs["storageEncrypted"] = state?.storageEncrypted; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["writer"] = state?.writer; } else { const args = argsOrState; if (args?.clusterIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'clusterIdentifier'"); } if (args?.instanceClass === undefined && !opts.urn) { throw new Error("Missing required property 'instanceClass'"); } resourceInputs["applyImmediately"] = args?.applyImmediately; resourceInputs["autoMinorVersionUpgrade"] = args?.autoMinorVersionUpgrade; resourceInputs["availabilityZone"] = args?.availabilityZone; resourceInputs["caCertIdentifier"] = args?.caCertIdentifier; resourceInputs["clusterIdentifier"] = args?.clusterIdentifier; resourceInputs["copyTagsToSnapshot"] = args?.copyTagsToSnapshot; resourceInputs["enablePerformanceInsights"] = args?.enablePerformanceInsights; resourceInputs["engine"] = args?.engine; resourceInputs["identifier"] = args?.identifier; resourceInputs["identifierPrefix"] = args?.identifierPrefix; resourceInputs["instanceClass"] = args?.instanceClass; resourceInputs["performanceInsightsKmsKeyId"] = args?.performanceInsightsKmsKeyId; resourceInputs["preferredMaintenanceWindow"] = args?.preferredMaintenanceWindow; resourceInputs["promotionTier"] = args?.promotionTier; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; 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