@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
129 lines • 6 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.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, { ...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?.adminUserName;
resourceInputs["adminUserPassword"] = state?.adminUserPassword;
resourceInputs["arn"] = state?.arn;
resourceInputs["authType"] = state?.authType;
resourceInputs["backupRetentionPeriod"] = state?.backupRetentionPeriod;
resourceInputs["endpoint"] = state?.endpoint;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["name"] = state?.name;
resourceInputs["preferredBackupWindow"] = state?.preferredBackupWindow;
resourceInputs["preferredMaintenanceWindow"] = state?.preferredMaintenanceWindow;
resourceInputs["region"] = state?.region;
resourceInputs["shardCapacity"] = state?.shardCapacity;
resourceInputs["shardCount"] = state?.shardCount;
resourceInputs["subnetIds"] = state?.subnetIds;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["vpcSecurityGroupIds"] = state?.vpcSecurityGroupIds;
}
else {
const args = argsOrState;
if (args?.adminUserName === undefined && !opts.urn) {
throw new Error("Missing required property 'adminUserName'");
}
if (args?.adminUserPassword === undefined && !opts.urn) {
throw new Error("Missing required property 'adminUserPassword'");
}
if (args?.authType === undefined && !opts.urn) {
throw new Error("Missing required property 'authType'");
}
if (args?.shardCapacity === undefined && !opts.urn) {
throw new Error("Missing required property 'shardCapacity'");
}
if (args?.shardCount === undefined && !opts.urn) {
throw new Error("Missing required property 'shardCount'");
}
resourceInputs["adminUserName"] = args?.adminUserName;
resourceInputs["adminUserPassword"] = args?.adminUserPassword ? pulumi.secret(args.adminUserPassword) : undefined;
resourceInputs["authType"] = args?.authType;
resourceInputs["backupRetentionPeriod"] = args?.backupRetentionPeriod;
resourceInputs["kmsKeyId"] = args?.kmsKeyId;
resourceInputs["name"] = args?.name;
resourceInputs["preferredBackupWindow"] = args?.preferredBackupWindow;
resourceInputs["preferredMaintenanceWindow"] = args?.preferredMaintenanceWindow;
resourceInputs["region"] = args?.region;
resourceInputs["shardCapacity"] = args?.shardCapacity;
resourceInputs["shardCount"] = args?.shardCount;
resourceInputs["subnetIds"] = args?.subnetIds;
resourceInputs["tags"] = args?.tags;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["vpcSecurityGroupIds"] = args?.vpcSecurityGroupIds;
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
;