@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
162 lines • 10.2 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.Cluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a DocumentDB Cluster.
*
* Changes to a DocumentDB Cluster can occur when you manually change a
* parameter, such as `port`, and are reflected in the next maintenance
* window. Because of this, this provider may report a difference in its planning
* phase because a modification has not yet taken place. You can use the
* `applyImmediately` flag to instruct the service to apply the change immediately
* (see documentation below).
*
* > **Note:** using `applyImmediately` can result in a brief downtime as the server reboots.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const docdb = new aws.docdb.Cluster("docdb", {
* clusterIdentifier: "my-docdb-cluster",
* engine: "docdb",
* masterUsername: "foo",
* masterPassword: "mustbeeightchars",
* backupRetentionPeriod: 5,
* preferredBackupWindow: "07:00-09:00",
* skipFinalSnapshot: true,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import DocumentDB Clusters using the `cluster_identifier`. For example:
*
* ```sh
* $ pulumi import aws:docdb/cluster:Cluster docdb_cluster docdb-prod-cluster
* ```
*/
class Cluster extends pulumi.CustomResource {
/**
* Get an existing Cluster 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 Cluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Cluster. 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'] === Cluster.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowMajorVersionUpgrade"] = state ? state.allowMajorVersionUpgrade : undefined;
resourceInputs["applyImmediately"] = state ? state.applyImmediately : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["availabilityZones"] = state ? state.availabilityZones : undefined;
resourceInputs["backupRetentionPeriod"] = state ? state.backupRetentionPeriod : undefined;
resourceInputs["clusterIdentifier"] = state ? state.clusterIdentifier : undefined;
resourceInputs["clusterIdentifierPrefix"] = state ? state.clusterIdentifierPrefix : undefined;
resourceInputs["clusterMembers"] = state ? state.clusterMembers : undefined;
resourceInputs["clusterResourceId"] = state ? state.clusterResourceId : undefined;
resourceInputs["dbClusterParameterGroupName"] = state ? state.dbClusterParameterGroupName : undefined;
resourceInputs["dbSubnetGroupName"] = state ? state.dbSubnetGroupName : undefined;
resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined;
resourceInputs["enabledCloudwatchLogsExports"] = state ? state.enabledCloudwatchLogsExports : undefined;
resourceInputs["endpoint"] = state ? state.endpoint : undefined;
resourceInputs["engine"] = state ? state.engine : undefined;
resourceInputs["engineVersion"] = state ? state.engineVersion : undefined;
resourceInputs["finalSnapshotIdentifier"] = state ? state.finalSnapshotIdentifier : undefined;
resourceInputs["globalClusterIdentifier"] = state ? state.globalClusterIdentifier : undefined;
resourceInputs["hostedZoneId"] = state ? state.hostedZoneId : undefined;
resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined;
resourceInputs["manageMasterUserPassword"] = state ? state.manageMasterUserPassword : undefined;
resourceInputs["masterPassword"] = state ? state.masterPassword : undefined;
resourceInputs["masterUserSecrets"] = state ? state.masterUserSecrets : undefined;
resourceInputs["masterUsername"] = state ? state.masterUsername : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["preferredBackupWindow"] = state ? state.preferredBackupWindow : undefined;
resourceInputs["preferredMaintenanceWindow"] = state ? state.preferredMaintenanceWindow : undefined;
resourceInputs["readerEndpoint"] = state ? state.readerEndpoint : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["restoreToPointInTime"] = state ? state.restoreToPointInTime : undefined;
resourceInputs["serverlessV2ScalingConfiguration"] = state ? state.serverlessV2ScalingConfiguration : undefined;
resourceInputs["skipFinalSnapshot"] = state ? state.skipFinalSnapshot : undefined;
resourceInputs["snapshotIdentifier"] = state ? state.snapshotIdentifier : undefined;
resourceInputs["storageEncrypted"] = state ? state.storageEncrypted : undefined;
resourceInputs["storageType"] = state ? state.storageType : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["vpcSecurityGroupIds"] = state ? state.vpcSecurityGroupIds : undefined;
}
else {
const args = argsOrState;
resourceInputs["allowMajorVersionUpgrade"] = args ? args.allowMajorVersionUpgrade : undefined;
resourceInputs["applyImmediately"] = args ? args.applyImmediately : undefined;
resourceInputs["availabilityZones"] = args ? args.availabilityZones : undefined;
resourceInputs["backupRetentionPeriod"] = args ? args.backupRetentionPeriod : undefined;
resourceInputs["clusterIdentifier"] = args ? args.clusterIdentifier : undefined;
resourceInputs["clusterIdentifierPrefix"] = args ? args.clusterIdentifierPrefix : undefined;
resourceInputs["clusterMembers"] = args ? args.clusterMembers : undefined;
resourceInputs["dbClusterParameterGroupName"] = args ? args.dbClusterParameterGroupName : undefined;
resourceInputs["dbSubnetGroupName"] = args ? args.dbSubnetGroupName : undefined;
resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined;
resourceInputs["enabledCloudwatchLogsExports"] = args ? args.enabledCloudwatchLogsExports : undefined;
resourceInputs["engine"] = args ? args.engine : undefined;
resourceInputs["engineVersion"] = args ? args.engineVersion : undefined;
resourceInputs["finalSnapshotIdentifier"] = args ? args.finalSnapshotIdentifier : undefined;
resourceInputs["globalClusterIdentifier"] = args ? args.globalClusterIdentifier : undefined;
resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined;
resourceInputs["manageMasterUserPassword"] = args ? args.manageMasterUserPassword : undefined;
resourceInputs["masterPassword"] = (args === null || args === void 0 ? void 0 : args.masterPassword) ? pulumi.secret(args.masterPassword) : undefined;
resourceInputs["masterUsername"] = args ? args.masterUsername : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["preferredBackupWindow"] = args ? args.preferredBackupWindow : undefined;
resourceInputs["preferredMaintenanceWindow"] = args ? args.preferredMaintenanceWindow : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["restoreToPointInTime"] = args ? args.restoreToPointInTime : undefined;
resourceInputs["serverlessV2ScalingConfiguration"] = args ? args.serverlessV2ScalingConfiguration : undefined;
resourceInputs["skipFinalSnapshot"] = args ? args.skipFinalSnapshot : undefined;
resourceInputs["snapshotIdentifier"] = args ? args.snapshotIdentifier : undefined;
resourceInputs["storageEncrypted"] = args ? args.storageEncrypted : undefined;
resourceInputs["storageType"] = args ? args.storageType : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["vpcSecurityGroupIds"] = args ? args.vpcSecurityGroupIds : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["clusterResourceId"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["hostedZoneId"] = undefined /*out*/;
resourceInputs["masterUserSecrets"] = undefined /*out*/;
resourceInputs["readerEndpoint"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["masterPassword"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Cluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.Cluster = Cluster;
/** @internal */
Cluster.__pulumiType = 'aws:docdb/cluster:Cluster';
//# sourceMappingURL=cluster.js.map