UNPKG

@pulumi/aws

Version:

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

183 lines • 10.2 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 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, { ...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["customIamInstanceProfile"] = state?.customIamInstanceProfile; resourceInputs["dbParameterGroupName"] = state?.dbParameterGroupName; resourceInputs["dbSubnetGroupName"] = state?.dbSubnetGroupName; resourceInputs["dbiResourceId"] = state?.dbiResourceId; resourceInputs["endpoint"] = state?.endpoint; resourceInputs["engine"] = state?.engine; resourceInputs["engineVersion"] = state?.engineVersion; resourceInputs["engineVersionActual"] = state?.engineVersionActual; resourceInputs["forceDestroy"] = state?.forceDestroy; resourceInputs["identifier"] = state?.identifier; resourceInputs["identifierPrefix"] = state?.identifierPrefix; resourceInputs["instanceClass"] = state?.instanceClass; resourceInputs["kmsKeyId"] = state?.kmsKeyId; resourceInputs["monitoringInterval"] = state?.monitoringInterval; resourceInputs["monitoringRoleArn"] = state?.monitoringRoleArn; resourceInputs["networkType"] = state?.networkType; resourceInputs["performanceInsightsEnabled"] = state?.performanceInsightsEnabled; resourceInputs["performanceInsightsKmsKeyId"] = state?.performanceInsightsKmsKeyId; resourceInputs["performanceInsightsRetentionPeriod"] = state?.performanceInsightsRetentionPeriod; 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?.engine === undefined && !opts.urn) { throw new Error("Missing required property 'engine'"); } 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["customIamInstanceProfile"] = args?.customIamInstanceProfile; resourceInputs["dbParameterGroupName"] = args?.dbParameterGroupName; resourceInputs["dbSubnetGroupName"] = args?.dbSubnetGroupName; resourceInputs["engine"] = args?.engine; resourceInputs["engineVersion"] = args?.engineVersion; resourceInputs["forceDestroy"] = args?.forceDestroy; resourceInputs["identifier"] = args?.identifier; resourceInputs["identifierPrefix"] = args?.identifierPrefix; resourceInputs["instanceClass"] = args?.instanceClass; resourceInputs["monitoringInterval"] = args?.monitoringInterval; resourceInputs["monitoringRoleArn"] = args?.monitoringRoleArn; resourceInputs["performanceInsightsEnabled"] = args?.performanceInsightsEnabled; resourceInputs["performanceInsightsKmsKeyId"] = args?.performanceInsightsKmsKeyId; resourceInputs["performanceInsightsRetentionPeriod"] = args?.performanceInsightsRetentionPeriod; resourceInputs["preferredBackupWindow"] = args?.preferredBackupWindow; resourceInputs["preferredMaintenanceWindow"] = args?.preferredMaintenanceWindow; resourceInputs["promotionTier"] = args?.promotionTier; resourceInputs["publiclyAccessible"] = args?.publiclyAccessible; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; 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