Interface DatabaseClusterProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
DatabaseClusterProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:15.324Z") @Stability(Stable) public interface DatabaseClusterProps extends software.amazon.jsii.JsiiSerializable
Properties for a new database cluster.

Example:

 Vpc vpc;
 DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database")
         .masterUser(Login.builder()
                 .username("myuser")
                 .build())
         .instanceType(InstanceType.of(InstanceClass.MEMORY5, InstanceSize.LARGE))
         .vpcSubnets(SubnetSelection.builder()
                 .subnetType(SubnetType.PUBLIC)
                 .build())
         .vpc(vpc)
         .removalPolicy(RemovalPolicy.SNAPSHOT)
         .build();
 
  • Method Details

    • getInstanceType

      @Stability(Stable) @NotNull InstanceType getInstanceType()
      What type of instance to start for the replicas.
    • getMasterUser

      @Stability(Stable) @NotNull Login getMasterUser()
      Username and password for the administrative user.
    • getVpc

      @Stability(Stable) @NotNull IVpc getVpc()
      What subnets to run the DocumentDB instances in.

      Must be at least 2 subnets in two different AZs.

    • getBackup

      @Stability(Stable) @Nullable default BackupProps getBackup()
      Backup settings.

      Default: - Backup retention period for automated backups is 1 day. Backup preferred window is set to a 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:
    • getCloudWatchLogsRetention

      @Stability(Stable) @Nullable default RetentionDays getCloudWatchLogsRetention()
      The number of days log events are kept in CloudWatch Logs.

      When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to Infinity.

      Default: - logs never expire

    • getCloudWatchLogsRetentionRole

      @Stability(Stable) @Nullable default IRole getCloudWatchLogsRetentionRole()
      The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

      Default: - a new role is created.

    • getDbClusterName

      @Stability(Stable) @Nullable default String getDbClusterName()
      An optional identifier for the cluster.

      Default: - A name is automatically generated.

    • getDeletionProtection

      @Stability(Stable) @Nullable default Boolean getDeletionProtection()
      Specifies whether this cluster can be deleted.

      If deletionProtection is enabled, the cluster cannot be deleted unless it is modified and deletionProtection is disabled. deletionProtection protects clusters from being accidentally deleted.

      Default: - false

    • getEnablePerformanceInsights

      @Stability(Stable) @Nullable default Boolean getEnablePerformanceInsights()
      A value that indicates whether to enable Performance Insights for the instances in the DB Cluster.

      Default: - false

    • getEngineVersion

      @Stability(Stable) @Nullable default String getEngineVersion()
      What version of the database to start.

      Default: - The default engine version.

    • getExportAuditLogsToCloudWatch

      @Stability(Stable) @Nullable default Boolean getExportAuditLogsToCloudWatch()
      Whether the audit logs should be exported to CloudWatch.

      Note that you also have to configure the audit log export in the Cluster's Parameter Group.

      Default: false

      See Also:
    • getExportProfilerLogsToCloudWatch

      @Stability(Stable) @Nullable default Boolean getExportProfilerLogsToCloudWatch()
      Whether the profiler logs should be exported to CloudWatch.

      Note that you also have to configure the profiler log export in the Cluster's Parameter Group.

      Default: false

      See Also:
    • getInstanceIdentifierBase

      @Stability(Stable) @Nullable default String getInstanceIdentifierBase()
      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.

    • getInstanceRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getInstanceRemovalPolicy()
      The removal policy to apply to the cluster's instances.

      Cannot be set to SNAPSHOT.

      Default: - `RemovalPolicy.DESTROY` when `removalPolicy` is set to `SNAPSHOT`, `removalPolicy` otherwise.

      See Also:
    • getInstances

      @Stability(Stable) @Nullable default Number getInstances()
      Number of DocDB compute instances.

      Default: 1

    • getKmsKey

      @Stability(Stable) @Nullable default IKey getKmsKey()
      The KMS key for storage encryption.

      Default: - default master key.

    • getParameterGroup

      @Stability(Stable) @Nullable default IClusterParameterGroup getParameterGroup()
      The DB parameter group to associate with the instance.

      Default: no parameter group

    • getPort

      @Stability(Stable) @Nullable default Number getPort()
      The port the DocumentDB cluster will listen on.

      Default: DatabaseCluster.DEFAULT_PORT

    • getPreferredMaintenanceWindow

      @Stability(Stable) @Nullable default String getPreferredMaintenanceWindow()
      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.

      See Also:
    • getRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getRemovalPolicy()
      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.

      When set to SNAPSHOT, the removal policy for the instances and the security group will default to DESTROY as those resources do not support the policy.

      Use the instanceRemovalPolicy and securityGroupRemovalPolicy to change the behavior.

      Default: - Retain cluster.

    • getSecurityGroup

      @Stability(Stable) @Nullable default ISecurityGroup getSecurityGroup()
      Security group.

      Default: a new security group is created.

    • getSecurityGroupRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getSecurityGroupRemovalPolicy()
      The removal policy to apply to the cluster's security group.

      Cannot be set to SNAPSHOT.

      Default: - `RemovalPolicy.DESTROY` when `removalPolicy` is set to `SNAPSHOT`, `removalPolicy` otherwise.

      See Also:
    • getStorageEncrypted

      @Stability(Stable) @Nullable default Boolean getStorageEncrypted()
      Whether to enable storage encryption.

      Default: true

    • getVpcSubnets

      @Stability(Stable) @Nullable default SubnetSelection getVpcSubnets()
      Where to place the instances within the VPC.

      Default: private subnets

    • builder

      @Stability(Stable) static DatabaseClusterProps.Builder builder()
      Returns:
      a DatabaseClusterProps.Builder of DatabaseClusterProps