Class DatabaseCluster.Builder

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

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

    • create

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

      @Stability(Experimental) public DatabaseCluster.Builder instanceType(InstanceType instanceType)
      (experimental) What type of instance to start for the replicas.

      Parameters:
      instanceType - What type of instance to start for the replicas. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Experimental) public DatabaseCluster.Builder vpc(IVpc vpc)
      (experimental) What subnets to run the Neptune instances in.

      Must be at least 2 subnets in two different AZs.

      Parameters:
      vpc - What subnets to run the Neptune instances in. This parameter is required.
      Returns:
      this
    • associatedRoles

      @Stability(Experimental) public DatabaseCluster.Builder associatedRoles(List<? extends IRole> associatedRoles)
      (experimental) A list of AWS Identity and Access Management (IAM) role that can be used by the cluster to access other AWS services.

      Default: - No role is attached to the cluster.

      Parameters:
      associatedRoles - A list of AWS Identity and Access Management (IAM) role that can be used by the cluster to access other AWS services. This parameter is required.
      Returns:
      this
    • autoMinorVersionUpgrade

      @Stability(Experimental) public DatabaseCluster.Builder autoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade)
      (experimental) If set to true, Neptune will automatically update the engine of the entire cluster to the latest minor version after a stabilization window of 2 to 3 weeks.

      Default: - false

      Parameters:
      autoMinorVersionUpgrade - If set to true, Neptune will automatically update the engine of the entire cluster to the latest minor version after a stabilization window of 2 to 3 weeks. This parameter is required.
      Returns:
      this
    • backupRetention

      @Stability(Experimental) public DatabaseCluster.Builder backupRetention(Duration backupRetention)
      (experimental) How many days to retain the backup.

      Default: - cdk.Duration.days(1)

      Parameters:
      backupRetention - How many days to retain the backup. This parameter is required.
      Returns:
      this
    • clusterParameterGroup

      @Stability(Experimental) public DatabaseCluster.Builder clusterParameterGroup(IClusterParameterGroup clusterParameterGroup)
      (experimental) Additional parameters to pass to the database engine.

      Default: - No parameter group.

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

      @Stability(Experimental) public DatabaseCluster.Builder dbClusterName(String dbClusterName)
      (experimental) An optional identifier for the cluster.

      Default: - A name is automatically generated.

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

      @Stability(Experimental) public DatabaseCluster.Builder deletionProtection(Boolean deletionProtection)
      (experimental) 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
    • engineVersion

      @Stability(Experimental) public DatabaseCluster.Builder engineVersion(EngineVersion engineVersion)
      (experimental) What version of the database to start.

      Default: - The default engine version.

      Parameters:
      engineVersion - What version of the database to start. This parameter is required.
      Returns:
      this
    • iamAuthentication

      @Stability(Experimental) public DatabaseCluster.Builder iamAuthentication(Boolean iamAuthentication)
      (experimental) Map AWS Identity and Access Management (IAM) accounts to database accounts.

      Default: - `false`

      Parameters:
      iamAuthentication - Map AWS Identity and Access Management (IAM) accounts to database accounts. This parameter is required.
      Returns:
      this
    • instanceIdentifierBase

      @Stability(Experimental) public DatabaseCluster.Builder instanceIdentifierBase(String instanceIdentifierBase)
      (experimental) Base identifier for instances.

      Every replica is named by appending the replica number to this string, 1-based.

      Default: - `dbClusterName` is used with the word "Instance" appended. If `dbClusterName` is not provided, the identifier is automatically generated.

      Parameters:
      instanceIdentifierBase - Base identifier for instances. This parameter is required.
      Returns:
      this
    • instances

      @Stability(Experimental) public DatabaseCluster.Builder instances(Number instances)
      (experimental) Number of Neptune compute instances.

      Default: 1

      Parameters:
      instances - Number of Neptune compute instances. This parameter is required.
      Returns:
      this
    • kmsKey

      @Stability(Experimental) public DatabaseCluster.Builder kmsKey(IKey kmsKey)
      (experimental) The KMS key for storage encryption.

      Default: - default master key.

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

      @Stability(Experimental) public DatabaseCluster.Builder parameterGroup(IParameterGroup parameterGroup)
      (experimental) The DB parameter group to associate with the instance.

      Default: no parameter group

      Parameters:
      parameterGroup - The DB parameter group to associate with the instance. This parameter is required.
      Returns:
      this
    • port

      @Stability(Experimental) public DatabaseCluster.Builder port(Number port)
      (experimental) The port the Neptune cluster will listen on.

      Default: - The default engine port

      Parameters:
      port - The port the Neptune cluster will listen on. This parameter is required.
      Returns:
      this
    • preferredBackupWindow

      @Stability(Experimental) public DatabaseCluster.Builder preferredBackupWindow(String preferredBackupWindow)
      (experimental) A daily time range in 24-hours UTC format in which backups preferably execute.

      Must be at least 30 minutes long.

      Example: '01:00-02:00'

      Default: - a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see

      Parameters:
      preferredBackupWindow - A daily time range in 24-hours UTC format in which backups preferably execute. This parameter is required.
      Returns:
      this
    • preferredMaintenanceWindow

      @Stability(Experimental) public DatabaseCluster.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow)
      (experimental) A weekly time range in which maintenance should preferably execute.

      Must be at least 30 minutes long.

      Example: 'tue:04:17-tue:04:47'

      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.

      Parameters:
      preferredMaintenanceWindow - A weekly time range in which maintenance should preferably execute. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Experimental) public DatabaseCluster.Builder removalPolicy(RemovalPolicy removalPolicy)
      (experimental) The removal policy to apply when the cluster and its instances are removed or replaced during a stack update, or when the stack is deleted.

      This removal policy also applies to the implicit security group created for the cluster if one is not supplied as a parameter.

      Default: - Retain cluster.

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

      @Stability(Experimental) public DatabaseCluster.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      (experimental) Security group.

      Default: a new security group is created.

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

      @Stability(Experimental) public DatabaseCluster.Builder storageEncrypted(Boolean storageEncrypted)
      (experimental) Whether to enable storage encryption.

      Default: true

      Parameters:
      storageEncrypted - Whether to enable storage encryption. This parameter is required.
      Returns:
      this
    • subnetGroup

      @Stability(Experimental) public DatabaseCluster.Builder subnetGroup(ISubnetGroup subnetGroup)
      (experimental) Existing subnet group for the cluster.

      Default: - a new subnet group will be created.

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

      @Stability(Experimental) public DatabaseCluster.Builder vpcSubnets(SubnetSelection vpcSubnets)
      (experimental) Where to place the instances within the VPC.

      Default: private subnets

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

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