UNPKG

@pulumi/aws

Version:

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

129 lines 6.72 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.ElasticCluster = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS DocDB (DocumentDB) Elastic Cluster. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.docdb.ElasticCluster("example", { * name: "my-docdb-cluster", * adminUserName: "foo", * adminUserPassword: "mustbeeightchars", * authType: "PLAIN_TEXT", * shardCapacity: 2, * shardCount: 1, * }); * ``` * * ## Import * * Using `pulumi import`, import DocDB (DocumentDB) Elastic Cluster using the `arn` argument. For example, * * ```sh * $ pulumi import aws:docdb/elasticCluster:ElasticCluster example arn:aws:docdb-elastic:us-east-1:000011112222:cluster/12345678-7abc-def0-1234-56789abcdef * ``` */ class ElasticCluster extends pulumi.CustomResource { /** * Get an existing ElasticCluster 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 ElasticCluster(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ElasticCluster. 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'] === ElasticCluster.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["adminUserName"] = state ? state.adminUserName : undefined; resourceInputs["adminUserPassword"] = state ? state.adminUserPassword : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["authType"] = state ? state.authType : undefined; resourceInputs["backupRetentionPeriod"] = state ? state.backupRetentionPeriod : undefined; resourceInputs["endpoint"] = state ? state.endpoint : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["preferredBackupWindow"] = state ? state.preferredBackupWindow : undefined; resourceInputs["preferredMaintenanceWindow"] = state ? state.preferredMaintenanceWindow : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["shardCapacity"] = state ? state.shardCapacity : undefined; resourceInputs["shardCount"] = state ? state.shardCount : undefined; resourceInputs["subnetIds"] = state ? state.subnetIds : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["timeouts"] = state ? state.timeouts : undefined; resourceInputs["vpcSecurityGroupIds"] = state ? state.vpcSecurityGroupIds : undefined; } else { const args = argsOrState; if ((!args || args.adminUserName === undefined) && !opts.urn) { throw new Error("Missing required property 'adminUserName'"); } if ((!args || args.adminUserPassword === undefined) && !opts.urn) { throw new Error("Missing required property 'adminUserPassword'"); } if ((!args || args.authType === undefined) && !opts.urn) { throw new Error("Missing required property 'authType'"); } if ((!args || args.shardCapacity === undefined) && !opts.urn) { throw new Error("Missing required property 'shardCapacity'"); } if ((!args || args.shardCount === undefined) && !opts.urn) { throw new Error("Missing required property 'shardCount'"); } resourceInputs["adminUserName"] = args ? args.adminUserName : undefined; resourceInputs["adminUserPassword"] = (args === null || args === void 0 ? void 0 : args.adminUserPassword) ? pulumi.secret(args.adminUserPassword) : undefined; resourceInputs["authType"] = args ? args.authType : undefined; resourceInputs["backupRetentionPeriod"] = args ? args.backupRetentionPeriod : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["preferredBackupWindow"] = args ? args.preferredBackupWindow : undefined; resourceInputs["preferredMaintenanceWindow"] = args ? args.preferredMaintenanceWindow : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["shardCapacity"] = args ? args.shardCapacity : undefined; resourceInputs["shardCount"] = args ? args.shardCount : undefined; resourceInputs["subnetIds"] = args ? args.subnetIds : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["timeouts"] = args ? args.timeouts : undefined; resourceInputs["vpcSecurityGroupIds"] = args ? args.vpcSecurityGroupIds : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["endpoint"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["adminUserPassword"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ElasticCluster.__pulumiType, name, resourceInputs, opts); } } exports.ElasticCluster = ElasticCluster; /** @internal */ ElasticCluster.__pulumiType = 'aws:docdb/elasticCluster:ElasticCluster'; //# sourceMappingURL=elasticCluster.js.map