@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
183 lines • 11.4 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 RDS Cluster Instance Resource. A Cluster Instance Resource defines
* attributes that are specific to a single instance in a RDS Cluster,
* specifically running Amazon Aurora.
*
* Unlike other RDS resources that support replication, with Amazon Aurora you do
* not designate a primary and subsequent replicas. Instead, you simply add RDS
* Instances and Aurora manages the replication. You can use the [count][5]
* meta-parameter to make multiple instances and join them all to the same RDS
* Cluster, or you may specify different Cluster Instance resources with various
* `instanceClass` sizes.
*
* For more information on Amazon Aurora, see [Aurora on Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) in the Amazon RDS User Guide.
*
* > **NOTE:** Deletion Protection from the RDS service can only be enabled at the cluster level, not for individual cluster instances. You can still add the [`protect` CustomResourceOption](https://www.pulumi.com/docs/intro/concepts/programming-model/#protect) to this resource configuration if you desire protection from accidental deletion.
*
* > **NOTE:** `aurora` is no longer a valid `engine` because of [Amazon Aurora's MySQL-Compatible Edition version 1 end of life](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.MySQL56.EOL.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const _default = new aws.rds.Cluster("default", {
* clusterIdentifier: "aurora-cluster-demo",
* availabilityZones: [
* "us-west-2a",
* "us-west-2b",
* "us-west-2c",
* ],
* databaseName: "mydb",
* masterUsername: "foo",
* masterPassword: "barbut8chars",
* });
* const clusterInstances: aws.rds.ClusterInstance[] = [];
* for (const range = {value: 0}; range.value < 2; range.value++) {
* clusterInstances.push(new aws.rds.ClusterInstance(`cluster_instances-${range.value}`, {
* identifier: `aurora-cluster-demo-${range.value}`,
* clusterIdentifier: _default.id,
* instanceClass: aws.rds.InstanceType.R4_Large,
* engine: _default.engine.apply((x) => aws.rds.EngineType[x]),
* engineVersion: _default.engineVersion,
* }));
* }
* ```
*
* ## Import
*
* Using `pulumi import`, import RDS Cluster Instances using the `identifier`. For example:
*
* ```sh
* $ pulumi import aws:rds/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["customIamInstanceProfile"] = state ? state.customIamInstanceProfile : undefined;
resourceInputs["dbParameterGroupName"] = state ? state.dbParameterGroupName : undefined;
resourceInputs["dbSubnetGroupName"] = state ? state.dbSubnetGroupName : undefined;
resourceInputs["dbiResourceId"] = state ? state.dbiResourceId : undefined;
resourceInputs["endpoint"] = state ? state.endpoint : undefined;
resourceInputs["engine"] = state ? state.engine : undefined;
resourceInputs["engineVersion"] = state ? state.engineVersion : undefined;
resourceInputs["engineVersionActual"] = state ? state.engineVersionActual : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : 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["monitoringInterval"] = state ? state.monitoringInterval : undefined;
resourceInputs["monitoringRoleArn"] = state ? state.monitoringRoleArn : undefined;
resourceInputs["networkType"] = state ? state.networkType : undefined;
resourceInputs["performanceInsightsEnabled"] = state ? state.performanceInsightsEnabled : undefined;
resourceInputs["performanceInsightsKmsKeyId"] = state ? state.performanceInsightsKmsKeyId : undefined;
resourceInputs["performanceInsightsRetentionPeriod"] = state ? state.performanceInsightsRetentionPeriod : 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.engine === undefined) && !opts.urn) {
throw new Error("Missing required property 'engine'");
}
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["customIamInstanceProfile"] = args ? args.customIamInstanceProfile : undefined;
resourceInputs["dbParameterGroupName"] = args ? args.dbParameterGroupName : undefined;
resourceInputs["dbSubnetGroupName"] = args ? args.dbSubnetGroupName : undefined;
resourceInputs["engine"] = args ? args.engine : undefined;
resourceInputs["engineVersion"] = args ? args.engineVersion : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["identifierPrefix"] = args ? args.identifierPrefix : undefined;
resourceInputs["instanceClass"] = args ? args.instanceClass : undefined;
resourceInputs["monitoringInterval"] = args ? args.monitoringInterval : undefined;
resourceInputs["monitoringRoleArn"] = args ? args.monitoringRoleArn : undefined;
resourceInputs["performanceInsightsEnabled"] = args ? args.performanceInsightsEnabled : undefined;
resourceInputs["performanceInsightsKmsKeyId"] = args ? args.performanceInsightsKmsKeyId : undefined;
resourceInputs["performanceInsightsRetentionPeriod"] = args ? args.performanceInsightsRetentionPeriod : undefined;
resourceInputs["preferredBackupWindow"] = args ? args.preferredBackupWindow : undefined;
resourceInputs["preferredMaintenanceWindow"] = args ? args.preferredMaintenanceWindow : undefined;
resourceInputs["promotionTier"] = args ? args.promotionTier : undefined;
resourceInputs["publiclyAccessible"] = args ? args.publiclyAccessible : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["dbiResourceId"] = undefined /*out*/;
resourceInputs["endpoint"] = undefined /*out*/;
resourceInputs["engineVersionActual"] = undefined /*out*/;
resourceInputs["kmsKeyId"] = undefined /*out*/;
resourceInputs["networkType"] = undefined /*out*/;
resourceInputs["port"] = 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:rds/clusterInstance:ClusterInstance';
//# sourceMappingURL=clusterInstance.js.map