Interface DatabaseClusterProps

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

@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-04-10T22:22:33.917Z") @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")
         .engine(DatabaseClusterEngine.auroraMysql(AuroraMysqlClusterEngineProps.builder().version(AuroraMysqlEngineVersion.VER_3_01_0).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();
 
  • Method Details

    • getEngine

      @Stability(Stable) @NotNull IClusterEngine getEngine()
      What kind of database to start.
    • getBacktrackWindow

      @Stability(Stable) @Nullable default Duration getBacktrackWindow()
      The number of seconds to set a cluster's target backtrack window to.

      This feature is only supported by the Aurora MySQL database engine and cannot be enabled on existing clusters.

      Default: 0 seconds (no backtrack)

      See Also:
    • 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:
    • getCloudwatchLogsExports

      @Stability(Stable) @Nullable default List<String> getCloudwatchLogsExports()
      The list of log types that need to be enabled for exporting to CloudWatch Logs.

      Default: - no log exports

    • 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.

    • getClusterIdentifier

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

      Default: - A name is automatically generated.

    • getCopyTagsToSnapshot

      @Stability(Stable) @Nullable default Boolean getCopyTagsToSnapshot()
      Whether to copy tags to the snapshot when a snapshot is created.

      Default: - true

    • getCredentials

      @Stability(Stable) @Nullable default Credentials getCredentials()
      Credentials for the administrative user.

      Default: - A username of 'admin' (or 'postgres' for PostgreSQL) and SecretsManager-generated password

    • getDefaultDatabaseName

      @Stability(Stable) @Nullable default String getDefaultDatabaseName()
      Name of a database which is automatically created inside the cluster.

      Default: - Database is not created in cluster.

    • getDeletionProtection

      @Stability(Stable) @Nullable default Boolean getDeletionProtection()
      Indicates whether the DB cluster should have deletion protection enabled.

      Default: - true if `removalPolicy` is RETAIN, `undefined` otherwise, which will not enable deletion protection. To disable deletion protection after it has been enabled, you must explicitly set this value to `false`.

    • getDomain

      @Stability(Stable) @Nullable default String getDomain()
      Directory ID for associating the DB cluster with a specific Active Directory.

      Necessary for enabling Kerberos authentication. If specified, the DB cluster joins the given Active Directory, enabling Kerberos authentication. If not specified, the DB cluster will not be associated with any Active Directory, and Kerberos authentication will not be enabled.

      Default: - DB cluster is not associated with an Active Directory; Kerberos authentication is not enabled.

    • getDomainRole

      @Stability(Stable) @Nullable default IRole getDomainRole()
      The IAM role to be used when making API calls to the Directory Service.

      The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.

      Default: - If `DatabaseClusterBaseProps.domain` is specified, a role with the `AmazonRDSDirectoryServiceAccess` policy is automatically created.

    • getEnableDataApi

      @Stability(Stable) @Nullable default Boolean getEnableDataApi()
      Whether to enable the Data API for the cluster.

      Default: - false

    • getIamAuthentication

      @Stability(Stable) @Nullable default Boolean getIamAuthentication()
      Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.

      Default: false

    • 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: - clusterIdentifier is used with the word "Instance" appended. If clusterIdentifier is not provided, the identifier is automatically generated.

    • getInstanceProps

      @Stability(Deprecated) @Deprecated @Nullable default InstanceProps getInstanceProps()
      Deprecated.
      • use writer and readers instead
      (deprecated) Settings for the individual instances that are launched.

    • getInstances

      @Stability(Deprecated) @Deprecated @Nullable default Number getInstances()
      Deprecated.
      • use writer and readers instead
      (deprecated) How many replicas/instances to create.

      Has to be at least 1.

      Default: 2

    • getInstanceUpdateBehaviour

      @Stability(Stable) @Nullable default InstanceUpdateBehaviour getInstanceUpdateBehaviour()
      The ordering of updates for instances.

      Default: InstanceUpdateBehaviour.BULK

    • getMonitoringInterval

      @Stability(Stable) @Nullable default Duration getMonitoringInterval()
      The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.

      Default: no enhanced monitoring

    • getMonitoringRole

      @Stability(Stable) @Nullable default IRole getMonitoringRole()
      Role that will be used to manage DB instances monitoring.

      Default: - A role is automatically created for you

    • getNetworkType

      @Stability(Stable) @Nullable default NetworkType getNetworkType()
      The network type of the DB instance.

      Default: - IPV4

    • getParameterGroup

      @Stability(Stable) @Nullable default IParameterGroup getParameterGroup()
      Additional parameters to pass to the database engine.

      Default: - No parameter group.

    • getParameters

      @Stability(Stable) @Nullable default Map<String,String> getParameters()
      The parameters in the DBClusterParameterGroup to create automatically.

      You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBClusterParameterGroup.

      Default: - None

    • getPort

      @Stability(Stable) @Nullable default Number getPort()
      What port to listen on.

      Default: - The default for the engine is used.

    • getPreferredMaintenanceWindow

      @Stability(Stable) @Nullable default String 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:
    • getReaders

      @Stability(Stable) @Nullable default List<IClusterInstance> getReaders()
      A list of instances to create as cluster reader instances.

      Default: - no readers are created. The cluster will have a single writer/reader

    • getRemovalPolicy

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

    • getS3ExportBuckets

      @Stability(Stable) @Nullable default List<IBucket> getS3ExportBuckets()
      S3 buckets that you want to load data into. This feature is only supported by the Aurora database engine.

      This property must not be used if s3ExportRole is used.

      For MySQL:

      Default: - None

      See Also:
    • getS3ExportRole

      @Stability(Stable) @Nullable default IRole getS3ExportRole()
      Role that will be associated with this DB cluster to enable S3 export.

      This feature is only supported by the Aurora database engine.

      This property must not be used if s3ExportBuckets is used.

      For MySQL:

      Default: - New role is created if `s3ExportBuckets` is set, no role is defined otherwise

      See Also:
    • getS3ImportBuckets

      @Stability(Stable) @Nullable default List<IBucket> getS3ImportBuckets()
      S3 buckets that you want to load data from. This feature is only supported by the Aurora database engine.

      This property must not be used if s3ImportRole is used.

      For MySQL:

      Default: - None

      See Also:
    • getS3ImportRole

      @Stability(Stable) @Nullable default IRole getS3ImportRole()
      Role that will be associated with this DB cluster to enable S3 import.

      This feature is only supported by the Aurora database engine.

      This property must not be used if s3ImportBuckets is used.

      For MySQL:

      Default: - New role is created if `s3ImportBuckets` is set, no role is defined otherwise

      See Also:
    • getSecurityGroups

      @Stability(Stable) @Nullable default List<ISecurityGroup> getSecurityGroups()
      Security group.

      Default: a new security group is created.

    • getServerlessV2MaxCapacity

      @Stability(Stable) @Nullable default Number getServerlessV2MaxCapacity()
      The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.

      You can specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The largest value that you can use is 128 (256GB).

      The maximum capacity must be higher than 0.5 ACUs.

      Default: 2

      See Also:
    • getServerlessV2MinCapacity

      @Stability(Stable) @Nullable default Number getServerlessV2MinCapacity()
      The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.

      You can specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. The smallest value that you can use is 0.5.

      Default: 0.5

      See Also:
    • getStorageEncrypted

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

      Default: - true if storageEncryptionKey is provided, false otherwise

    • getStorageEncryptionKey

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

      If specified, storageEncrypted will be set to true.

      Default: - if storageEncrypted is true then the default master key, no key otherwise

    • getStorageType

      @Stability(Stable) @Nullable default DBClusterStorageType getStorageType()
      The storage type to be associated with the DB cluster.

      Default: - DBClusterStorageType.AURORA_IOPT1

    • getSubnetGroup

      @Stability(Stable) @Nullable default ISubnetGroup getSubnetGroup()
      Existing subnet group for the cluster.

      Default: - a new subnet group will be created.

    • getVpc

      @Stability(Stable) @Nullable default IVpc getVpc()
      What subnets to run the RDS instances in.

      Must be at least 2 subnets in two different AZs.

    • getVpcSubnets

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

      Default: - the Vpc default strategy if not specified.

    • getWriter

      @Stability(Stable) @Nullable default IClusterInstance getWriter()
      The instance to use for the cluster writer.

      Default: required if instanceProps is not provided

    • builder

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