Interface ClusterInstanceOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
ClusterInstanceProps
,ProvisionedClusterInstanceProps
,ServerlessV2ClusterInstanceProps
- All Known Implementing Classes:
ClusterInstanceOptions.Jsii$Proxy
,ClusterInstanceProps.Jsii$Proxy
,ProvisionedClusterInstanceProps.Jsii$Proxy
,ServerlessV2ClusterInstanceProps.Jsii$Proxy
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.kms.*; import software.amazon.awscdk.services.rds.*; CaCertificate caCertificate; Key key; ParameterGroup parameterGroup; ClusterInstanceOptions clusterInstanceOptions = ClusterInstanceOptions.builder() .allowMajorVersionUpgrade(false) .autoMinorVersionUpgrade(false) .caCertificate(caCertificate) .enablePerformanceInsights(false) .instanceIdentifier("instanceIdentifier") .isFromLegacyInstanceProps(false) .parameterGroup(parameterGroup) .parameters(Map.of( "parametersKey", "parameters")) .performanceInsightEncryptionKey(key) .performanceInsightRetention(PerformanceInsightRetention.DEFAULT) .preferredMaintenanceWindow("preferredMaintenanceWindow") .publiclyAccessible(false) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forClusterInstanceOptions
static final class
An implementation forClusterInstanceOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default Boolean
Whether to allow upgrade of major version for the DB instance.default Boolean
Whether to enable automatic upgrade of minor version for the DB instance.default CaCertificate
The identifier of the CA certificate for this DB cluster's instances.default Boolean
Whether to enable Performance Insights for the DB instance.default String
The identifier for the database instance.default Boolean
Only used for migrating existing clusters from usinginstanceProps
towriter
andreaders
.default IParameterGroup
The DB parameter group to associate with the instance.The parameters in the DBParameterGroup to create automatically.default IKey
The AWS KMS key for encryption of Performance Insights data.default PerformanceInsightRetention
The amount of time, in days, to retain Performance Insights data.default String
A preferred maintenance window day/time range.default Boolean
Indicates whether the DB instance is an internet-facing instance.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAllowMajorVersionUpgrade
Whether to allow upgrade of major version for the DB instance.Default: - false
-
getAutoMinorVersionUpgrade
Whether to enable automatic upgrade of minor version for the DB instance.Default: - true
-
getCaCertificate
The identifier of the CA certificate for this DB cluster's instances.Specifying or updating this property triggers a reboot.
For RDS DB engines:
Default: - RDS will choose a certificate authority
- See Also:
-
getEnablePerformanceInsights
Whether to enable Performance Insights for the DB instance.Default: - false, unless ``performanceInsightRetention`` or ``performanceInsightEncryptionKey`` is set.
-
getInstanceIdentifier
The identifier for the database instance.Default: - CloudFormation generated identifier
-
getIsFromLegacyInstanceProps
Only used for migrating existing clusters from usinginstanceProps
towriter
andreaders
.Default: false
Example:
// existing cluster Vpc vpc; DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database") .engine(DatabaseClusterEngine.auroraMysql(AuroraMysqlClusterEngineProps.builder() .version(AuroraMysqlEngineVersion.VER_3_03_0) .build())) .instances(2) .instanceProps(InstanceProps.builder() .instanceType(InstanceType.of(InstanceClass.BURSTABLE3, InstanceSize.SMALL)) .vpcSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build()) .vpc(vpc) .build()) .build(); // migration Map<String, Object> instanceProps = Map.of( "instanceType", InstanceType.of(InstanceClass.BURSTABLE3, InstanceSize.SMALL), "isFromLegacyInstanceProps", true); DatabaseCluster myCluster = DatabaseCluster.Builder.create(this, "Database") .engine(DatabaseClusterEngine.auroraMysql(AuroraMysqlClusterEngineProps.builder() .version(AuroraMysqlEngineVersion.VER_3_03_0) .build())) .vpcSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build()) .vpc(vpc) .writer(ClusterInstance.provisioned("Instance1", ProvisionedClusterInstanceProps.builder() .instanceType(instanceProps.getInstanceType()) .isFromLegacyInstanceProps(instanceProps.getIsFromLegacyInstanceProps()) .build())) .readers(List.of(ClusterInstance.provisioned("Instance2", ProvisionedClusterInstanceProps.builder() .instanceType(instanceProps.getInstanceType()) .isFromLegacyInstanceProps(instanceProps.getIsFromLegacyInstanceProps()) .build()))) .build();
-
getParameterGroup
The DB parameter group to associate with the instance.This is only needed if you need to configure different parameter groups for each individual instance, otherwise you should not provide this and just use the cluster parameter group
Default: the cluster parameter group is used
-
getParameters
The parameters in the DBParameterGroup to create automatically.You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBParameterGroup.
Default: - None
-
getPerformanceInsightEncryptionKey
The AWS KMS key for encryption of Performance Insights data.Default: - default master key
-
getPerformanceInsightRetention
The amount of time, in days, to retain Performance Insights data.Default: 7
-
getPreferredMaintenanceWindow
A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).Example: 'Sun:23:45-Mon:00:15'
Default: - 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week.
- See Also:
-
getPubliclyAccessible
Indicates whether the DB instance is an internet-facing instance.If not specified, the cluster's vpcSubnets will be used to determine if the instance is internet-facing or not.
Default: - `true` if the cluster's `vpcSubnets` is `subnetType: SubnetType.PUBLIC`, `false` otherwise
-
builder
- Returns:
- a
ClusterInstanceOptions.Builder
ofClusterInstanceOptions
-