Package com.pulumi.aws.rds
Class ClusterInstance
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.rds.ClusterInstance
-
public class ClusterInstance extends com.pulumi.resources.CustomResourceProvides 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 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
## Import ### Identity Schema #### Required * `identifier` (String) Identifier of the RDS Cluster Instance. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. 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 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.rds.Cluster; import com.pulumi.aws.rds.ClusterArgs; import com.pulumi.aws.rds.ClusterInstance; import com.pulumi.aws.rds.ClusterInstanceArgs; import com.pulumi.codegen.internal.KeyedValue; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var default_ = new Cluster("default", ClusterArgs.builder() .clusterIdentifier("aurora-cluster-demo") .availabilityZones( "us-west-2a", "us-west-2b", "us-west-2c") .databaseName("mydb") .masterUsername("foo") .masterPassword("barbut8chars") .build()); for (var i = 0; i < 2; i++) { new ClusterInstance("clusterInstances-" + i, ClusterInstanceArgs.builder() .identifier(String.format("aurora-cluster-demo-%s", range.value())) .clusterIdentifier(default_.id()) .instanceClass("db.r4.large") .engine(default_.engine()) .engineVersion(default_.engineVersion()) .build()); } } }
-
-
Constructor Summary
Constructors Constructor Description ClusterInstance(java.lang.String name)ClusterInstance(java.lang.String name, ClusterInstanceArgs args)ClusterInstance(java.lang.String name, ClusterInstanceArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.Boolean>applyImmediately()com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>autoMinorVersionUpgrade()com.pulumi.core.Output<java.lang.String>availabilityZone()com.pulumi.core.Output<java.lang.String>caCertIdentifier()com.pulumi.core.Output<java.lang.String>clusterIdentifier()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>copyTagsToSnapshot()com.pulumi.core.Output<java.util.Optional<java.lang.String>>customIamInstanceProfile()com.pulumi.core.Output<java.lang.String>dbiResourceId()com.pulumi.core.Output<java.lang.String>dbParameterGroupName()com.pulumi.core.Output<java.lang.String>dbSubnetGroupName()com.pulumi.core.Output<java.lang.String>endpoint()com.pulumi.core.Output<EngineType>engine()com.pulumi.core.Output<java.lang.String>engineVersion()com.pulumi.core.Output<java.lang.String>engineVersionActual()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>forceDestroy()static ClusterInstanceget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ClusterInstanceState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>identifier()com.pulumi.core.Output<java.lang.String>identifierPrefix()com.pulumi.core.Output<java.lang.String>instanceClass()com.pulumi.core.Output<java.lang.String>kmsKeyId()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>monitoringInterval()com.pulumi.core.Output<java.lang.String>monitoringRoleArn()com.pulumi.core.Output<java.lang.String>networkType()com.pulumi.core.Output<java.lang.Boolean>performanceInsightsEnabled()com.pulumi.core.Output<java.lang.String>performanceInsightsKmsKeyId()com.pulumi.core.Output<java.lang.Integer>performanceInsightsRetentionPeriod()com.pulumi.core.Output<java.lang.Integer>port()com.pulumi.core.Output<java.lang.String>preferredBackupWindow()com.pulumi.core.Output<java.lang.String>preferredMaintenanceWindow()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>promotionTier()com.pulumi.core.Output<java.lang.Boolean>publiclyAccessible()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.Boolean>storageEncrypted()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>warningEventCategories()com.pulumi.core.Output<java.lang.Boolean>writer()
-
-
-
Constructor Detail
-
ClusterInstance
public ClusterInstance(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
ClusterInstance
public ClusterInstance(java.lang.String name, ClusterInstanceArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
ClusterInstance
public ClusterInstance(java.lang.String name, ClusterInstanceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
applyImmediately
public com.pulumi.core.Output<java.lang.Boolean> applyImmediately()
- Returns:
- Whether any database modifications are applied immediately, or during the next maintenance window. Default is `false`.
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of cluster instance
-
autoMinorVersionUpgrade
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> autoMinorVersionUpgrade()
- Returns:
- Whether minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`.
-
availabilityZone
public com.pulumi.core.Output<java.lang.String> availabilityZone()
- Returns:
- EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details.
-
caCertIdentifier
public com.pulumi.core.Output<java.lang.String> caCertIdentifier()
- Returns:
- Identifier of the CA certificate for the DB instance.
-
clusterIdentifier
public com.pulumi.core.Output<java.lang.String> clusterIdentifier()
- Returns:
- Identifier of the `aws.rds.Cluster` in which to launch this instance.
-
copyTagsToSnapshot
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> copyTagsToSnapshot()
- Returns:
- Whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`.
-
customIamInstanceProfile
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> customIamInstanceProfile()
- Returns:
- Instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
-
dbParameterGroupName
public com.pulumi.core.Output<java.lang.String> dbParameterGroupName()
- Returns:
- Name of the DB parameter group to associate with this instance.
-
dbSubnetGroupName
public com.pulumi.core.Output<java.lang.String> dbSubnetGroupName()
- Returns:
- DB subnet group to associate with this DB instance. The default behavior varies depending on whether `dbSubnetGroupName` is specified. Please refer to official [AWS documentation](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html) to understand how `dbSubnetGroupName` and `publiclyAccessible` parameters affect DB instance behaviour. **NOTE:** This must match the `dbSubnetGroupName` of the attached `aws.rds.Cluster`.
-
dbiResourceId
public com.pulumi.core.Output<java.lang.String> dbiResourceId()
- Returns:
- Region-unique, immutable identifier for the DB instance.
-
endpoint
public com.pulumi.core.Output<java.lang.String> endpoint()
- Returns:
- DNS address for this instance. May not be writable
-
engine
public com.pulumi.core.Output<EngineType> engine()
- Returns:
- Name of the database engine to be used for the RDS cluster instance. Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. (Note that `mysql` and `postgres` are Multi-AZ RDS clusters).
-
engineVersion
public com.pulumi.core.Output<java.lang.String> engineVersion()
- Returns:
- Database engine version. Please note that to upgrade the `engineVersion` of the instance, it must be done on the `aws.rds.Cluster` `engineVersion`. Trying to upgrade in `aws.rds.ClusterInstance` will not update the `engineVersion`.
-
engineVersionActual
public com.pulumi.core.Output<java.lang.String> engineVersionActual()
- Returns:
- Database engine version
-
forceDestroy
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> forceDestroy()
- Returns:
- Forces an instance to be destroyed when a part of a read replica cluster. **Note:** will promote the read replica to a standalone cluster before instance deletion.
-
identifier
public com.pulumi.core.Output<java.lang.String> identifier()
- Returns:
- Identifier for the RDS instance, if omitted, Pulumi will assign a random, unique identifier.
-
identifierPrefix
public com.pulumi.core.Output<java.lang.String> identifierPrefix()
- Returns:
- Creates a unique identifier beginning with the specified prefix. Conflicts with `identifier`.
-
instanceClass
public com.pulumi.core.Output<java.lang.String> instanceClass()
- Returns:
- Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html). Aurora uses `db.*` instance classes/types. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) for currently available instance classes and complete details. For Aurora Serverless v2 use `db.serverless`.
-
kmsKeyId
public com.pulumi.core.Output<java.lang.String> kmsKeyId()
- Returns:
- ARN for the KMS encryption key if one is set to the cluster.
-
monitoringInterval
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> monitoringInterval()
- Returns:
- Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60.
-
monitoringRoleArn
public com.pulumi.core.Output<java.lang.String> monitoringRoleArn()
- Returns:
- ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances.
-
networkType
public com.pulumi.core.Output<java.lang.String> networkType()
- Returns:
- Network type of the DB instance.
-
performanceInsightsEnabled
public com.pulumi.core.Output<java.lang.Boolean> performanceInsightsEnabled()
- Returns:
- Whether Performance Insights is enabled. **NOTE:** When Performance Insights is configured at the cluster level through `aws.rds.Cluster`, this argument cannot be set to a value that conflicts with the cluster's configuration.
-
performanceInsightsKmsKeyId
public com.pulumi.core.Output<java.lang.String> performanceInsightsKmsKeyId()
- Returns:
- ARN for the KMS key to encrypt Performance Insights data. When specifying `performanceInsightsKmsKeyId`, `performanceInsightsEnabled` needs to be set to true.
-
performanceInsightsRetentionPeriod
public com.pulumi.core.Output<java.lang.Integer> performanceInsightsRetentionPeriod()
- Returns:
- Amount of time in days to retain Performance Insights data. Valid values are `7`, `731` (2 years) or a multiple of `31`. When specifying `performanceInsightsRetentionPeriod`, `performanceInsightsEnabled` needs to be set to true. Defaults to '7'.
-
port
public com.pulumi.core.Output<java.lang.Integer> port()
- Returns:
- Database port
-
preferredBackupWindow
public com.pulumi.core.Output<java.lang.String> preferredBackupWindow()
- Returns:
- Daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferredBackupWindow` is set at the cluster level, this argument **must** be omitted.
-
preferredMaintenanceWindow
public com.pulumi.core.Output<java.lang.String> preferredMaintenanceWindow()
- Returns:
- Window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00".
-
promotionTier
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> promotionTier()
- Returns:
- Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.
-
publiclyAccessible
public com.pulumi.core.Output<java.lang.Boolean> publiclyAccessible()
- Returns:
- Bool to control if instance is publicly accessible. Default `false`. See the documentation on [Creating DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) for more details on controlling this property.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
storageEncrypted
public com.pulumi.core.Output<java.lang.Boolean> storageEncrypted()
- Returns:
- Whether the DB cluster is encrypted.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
warningEventCategories
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> warningEventCategories()
- Returns:
- Set of RDS event categories (for example `failure`, `maintenance`) to check for after create and update operations. If set, the provider describes RDS events reported for this instance during the operation and surfaces a warning diagnostic, with the RDS event message, for each one found in these categories. Has no effect if unset; see [DescribeEvents](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeEvents.html) and the `aws.rds.getEvents` data source for the source of these events. Requires the `rds:DescribeEvents` IAM permission when set.
-
writer
public com.pulumi.core.Output<java.lang.Boolean> writer()
- Returns:
- Boolean indicating if this instance is writable. `False` indicates this instance is a read replica.
-
get
public static ClusterInstance get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ClusterInstanceState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-