Class ServerlessCluster.Builder

java.lang.Object
software.amazon.awscdk.services.rds.ServerlessCluster.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ServerlessCluster>
Enclosing class:
ServerlessCluster

@Stability(Stable) public static final class ServerlessCluster.Builder extends Object implements software.amazon.jsii.Builder<ServerlessCluster>
A fluent builder for ServerlessCluster.
  • Method Details

    • create

      @Stability(Stable) public static ServerlessCluster.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of ServerlessCluster.Builder.
    • engine

      @Stability(Stable) public ServerlessCluster.Builder engine(IClusterEngine engine)
      What kind of database to start.

      Parameters:
      engine - What kind of database to start. This parameter is required.
      Returns:
      this
    • backupRetention

      @Stability(Stable) public ServerlessCluster.Builder backupRetention(Duration backupRetention)
      The number of days during which automatic DB snapshots are retained.

      Automatic backup retention cannot be disabled on serverless clusters. Must be a value from 1 day to 35 days.

      Default: Duration.days(1)

      Parameters:
      backupRetention - The number of days during which automatic DB snapshots are retained. This parameter is required.
      Returns:
      this
    • clusterIdentifier

      @Stability(Stable) public ServerlessCluster.Builder clusterIdentifier(String clusterIdentifier)
      An optional identifier for the cluster.

      Default: - A name is automatically generated.

      Parameters:
      clusterIdentifier - An optional identifier for the cluster. This parameter is required.
      Returns:
      this
    • credentials

      @Stability(Stable) public ServerlessCluster.Builder credentials(Credentials credentials)
      Credentials for the administrative user.

      Default: - A username of 'admin' and SecretsManager-generated password

      Parameters:
      credentials - Credentials for the administrative user. This parameter is required.
      Returns:
      this
    • defaultDatabaseName

      @Stability(Stable) public ServerlessCluster.Builder defaultDatabaseName(String defaultDatabaseName)
      Name of a database which is automatically created inside the cluster.

      Default: - Database is not created in cluster.

      Parameters:
      defaultDatabaseName - Name of a database which is automatically created inside the cluster. This parameter is required.
      Returns:
      this
    • deletionProtection

      @Stability(Stable) public ServerlessCluster.Builder deletionProtection(Boolean deletionProtection)
      Indicates whether the DB cluster should have deletion protection enabled.

      Default: - true if removalPolicy is RETAIN, false otherwise

      Parameters:
      deletionProtection - Indicates whether the DB cluster should have deletion protection enabled. This parameter is required.
      Returns:
      this
    • enableDataApi

      @Stability(Stable) public ServerlessCluster.Builder enableDataApi(Boolean enableDataApi)
      Whether to enable the Data API.

      Default: false

      Parameters:
      enableDataApi - Whether to enable the Data API. This parameter is required.
      Returns:
      this
      See Also:
    • parameterGroup

      @Stability(Stable) public ServerlessCluster.Builder parameterGroup(IParameterGroup parameterGroup)
      Additional parameters to pass to the database engine.

      Default: - no parameter group.

      Parameters:
      parameterGroup - Additional parameters to pass to the database engine. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public ServerlessCluster.Builder removalPolicy(RemovalPolicy removalPolicy)
      The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.

      Default: - RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)

      Parameters:
      removalPolicy - The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. This parameter is required.
      Returns:
      this
    • scaling

      @Stability(Stable) public ServerlessCluster.Builder scaling(ServerlessScalingOptions scaling)
      Scaling configuration of an Aurora Serverless database cluster.

      Default: - Serverless cluster is automatically paused after 5 minutes of being idle. minimum capacity: 2 ACU maximum capacity: 16 ACU

      Parameters:
      scaling - Scaling configuration of an Aurora Serverless database cluster. This parameter is required.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public ServerlessCluster.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      Security group.

      Default: - a new security group is created if `vpc` was provided. If the `vpc` property was not provided, no VPC security groups will be associated with the DB cluster.

      Parameters:
      securityGroups - Security group. This parameter is required.
      Returns:
      this
    • storageEncryptionKey

      @Stability(Stable) public ServerlessCluster.Builder storageEncryptionKey(IKey storageEncryptionKey)
      The KMS key for storage encryption.

      Default: - the default master key will be used for storage encryption

      Parameters:
      storageEncryptionKey - The KMS key for storage encryption. This parameter is required.
      Returns:
      this
    • subnetGroup

      @Stability(Stable) public ServerlessCluster.Builder subnetGroup(ISubnetGroup subnetGroup)
      Existing subnet group for the cluster.

      Default: - a new subnet group is created if `vpc` was provided. If the `vpc` property was not provided, no subnet group will be associated with the DB cluster

      Parameters:
      subnetGroup - Existing subnet group for the cluster. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Stable) public ServerlessCluster.Builder vpc(IVpc vpc)
      The VPC that this Aurora Serverless cluster has been created in.

      Default: - the default VPC in the account and region will be used

      Parameters:
      vpc - The VPC that this Aurora Serverless cluster has been created in. This parameter is required.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public ServerlessCluster.Builder vpcSubnets(SubnetSelection vpcSubnets)
      Where to place the instances within the VPC.

      If provided, the vpc property must also be specified.

      Default: - the VPC default strategy if not specified.

      Parameters:
      vpcSubnets - Where to place the instances within the VPC. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public ServerlessCluster build()
      Specified by:
      build in interface software.amazon.jsii.Builder<ServerlessCluster>
      Returns:
      a newly built instance of ServerlessCluster.