Class ClusterInstance

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.rds.ClusterInstance
All Implemented Interfaces:
IClusterInstance, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-17T21:37:37.983Z") @Stability(Stable) public class ClusterInstance extends software.amazon.jsii.JsiiObject implements IClusterInstance
Create an RDS Aurora Cluster Instance.

You can create either provisioned or serverless v2 instances.

Example:

 Vpc vpc;
 DatabaseCluster myCluster = DatabaseCluster.Builder.create(this, "Database")
         .engine(DatabaseClusterEngine.auroraMysql(AuroraMysqlClusterEngineProps.builder().version(AuroraMysqlEngineVersion.VER_2_08_1).build()))
         .writer(ClusterInstance.provisioned("writer", ProvisionedClusterInstanceProps.builder()
                 .instanceType(InstanceType.of(InstanceClass.R6G, InstanceSize.XLARGE4))
                 .build()))
         .serverlessV2MinCapacity(6.5)
         .serverlessV2MaxCapacity(64)
         .readers(List.of(ClusterInstance.serverlessV2("reader1", ServerlessV2ClusterInstanceProps.builder().scaleWithWriter(true).build()), ClusterInstance.serverlessV2("reader2")))
         .vpc(vpc)
         .build();
 
  • Constructor Details

    • ClusterInstance

      protected ClusterInstance(software.amazon.jsii.JsiiObjectRef objRef)
    • ClusterInstance

      protected ClusterInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • provisioned

      @Stability(Stable) @NotNull public static IClusterInstance provisioned(@NotNull String id, @Nullable ProvisionedClusterInstanceProps props)
      Add a provisioned instance to the cluster.

      Example:

       ClusterInstance.provisioned("ClusterInstance", ProvisionedClusterInstanceProps.builder()
               .instanceType(InstanceType.of(InstanceClass.R6G, InstanceSize.XLARGE4))
               .build());
       

      Parameters:
      id - This parameter is required.
      props -
    • provisioned

      @Stability(Stable) @NotNull public static IClusterInstance provisioned(@NotNull String id)
      Add a provisioned instance to the cluster.

      Example:

       ClusterInstance.provisioned("ClusterInstance", ProvisionedClusterInstanceProps.builder()
               .instanceType(InstanceType.of(InstanceClass.R6G, InstanceSize.XLARGE4))
               .build());
       

      Parameters:
      id - This parameter is required.
    • serverlessV2

      @Stability(Stable) @NotNull public static IClusterInstance serverlessV2(@NotNull String id, @Nullable ServerlessV2ClusterInstanceProps props)
      Add a serverless v2 instance to the cluster.

      Example:

       ClusterInstance.serverlessV2("ClusterInstance", ServerlessV2ClusterInstanceProps.builder()
               .scaleWithWriter(true)
               .build());
       

      Parameters:
      id - This parameter is required.
      props -
    • serverlessV2

      @Stability(Stable) @NotNull public static IClusterInstance serverlessV2(@NotNull String id)
      Add a serverless v2 instance to the cluster.

      Example:

       ClusterInstance.serverlessV2("ClusterInstance", ServerlessV2ClusterInstanceProps.builder()
               .scaleWithWriter(true)
               .build());
       

      Parameters:
      id - This parameter is required.
    • bind

      @Stability(Stable) @NotNull public IAuroraClusterInstance bind(@NotNull software.constructs.Construct scope, @NotNull IDatabaseCluster cluster, @NotNull ClusterInstanceBindOptions props)
      Add the ClusterInstance to the cluster.

      Specified by:
      bind in interface IClusterInstance
      Parameters:
      scope - This parameter is required.
      cluster - This parameter is required.
      props - This parameter is required.