public static final class DatabaseCluster.Builder
extends java.lang.Object
DatabaseCluster
.Modifier and Type | Method and Description |
---|---|
DatabaseCluster.Builder |
backup(BackupProps backup)
Backup settings.
|
DatabaseCluster |
build() |
DatabaseCluster.Builder |
cloudWatchLogsRetention(RetentionDays cloudWatchLogsRetention)
The number of days log events are kept in CloudWatch Logs.
|
DatabaseCluster.Builder |
cloudWatchLogsRetentionRole(IRole cloudWatchLogsRetentionRole)
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
|
static DatabaseCluster.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
DatabaseCluster.Builder |
dbClusterName(java.lang.String dbClusterName)
An optional identifier for the cluster.
|
DatabaseCluster.Builder |
deletionProtection(java.lang.Boolean deletionProtection)
Specifies whether this cluster can be deleted.
|
DatabaseCluster.Builder |
engineVersion(java.lang.String engineVersion)
What version of the database to start.
|
DatabaseCluster.Builder |
exportAuditLogsToCloudWatch(java.lang.Boolean exportAuditLogsToCloudWatch)
Whether the audit logs should be exported to CloudWatch.
|
DatabaseCluster.Builder |
exportProfilerLogsToCloudWatch(java.lang.Boolean exportProfilerLogsToCloudWatch)
Whether the profiler logs should be exported to CloudWatch.
|
DatabaseCluster.Builder |
instanceIdentifierBase(java.lang.String instanceIdentifierBase)
Base identifier for instances.
|
DatabaseCluster.Builder |
instances(java.lang.Number instances)
Number of DocDB compute instances.
|
DatabaseCluster.Builder |
instanceType(InstanceType instanceType)
What type of instance to start for the replicas.
|
DatabaseCluster.Builder |
kmsKey(IKey kmsKey)
The KMS key for storage encryption.
|
DatabaseCluster.Builder |
masterUser(Login masterUser)
Username and password for the administrative user.
|
DatabaseCluster.Builder |
parameterGroup(IClusterParameterGroup parameterGroup)
The DB parameter group to associate with the instance.
|
DatabaseCluster.Builder |
port(java.lang.Number port)
The port the DocumentDB cluster will listen on.
|
DatabaseCluster.Builder |
preferredMaintenanceWindow(java.lang.String preferredMaintenanceWindow)
A weekly time range in which maintenance should preferably execute.
|
DatabaseCluster.Builder |
removalPolicy(RemovalPolicy 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.
|
DatabaseCluster.Builder |
securityGroup(ISecurityGroup securityGroup)
Security group.
|
DatabaseCluster.Builder |
storageEncrypted(java.lang.Boolean storageEncrypted)
Whether to enable storage encryption.
|
DatabaseCluster.Builder |
vpc(IVpc vpc)
What subnets to run the DocumentDB instances in.
|
DatabaseCluster.Builder |
vpcSubnets(SubnetSelection vpcSubnets)
Where to place the instances within the VPC.
|
public static DatabaseCluster.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.DatabaseCluster.Builder
.public DatabaseCluster.Builder instanceType(InstanceType instanceType)
instanceType
- What type of instance to start for the replicas. This parameter is required.this
public DatabaseCluster.Builder masterUser(Login masterUser)
masterUser
- Username and password for the administrative user. This parameter is required.this
public DatabaseCluster.Builder vpc(IVpc vpc)
Must be at least 2 subnets in two different AZs.
vpc
- What subnets to run the DocumentDB instances in. This parameter is required.this
public DatabaseCluster.Builder backup(BackupProps backup)
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.
backup
- Backup settings. This parameter is required.this
https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.db-cluster-snapshots.html#backup-restore.backup-window
public DatabaseCluster.Builder cloudWatchLogsRetention(RetentionDays cloudWatchLogsRetention)
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
cloudWatchLogsRetention
- The number of days log events are kept in CloudWatch Logs. This parameter is required.this
public DatabaseCluster.Builder cloudWatchLogsRetentionRole(IRole cloudWatchLogsRetentionRole)
Default: - a new role is created.
cloudWatchLogsRetentionRole
- The IAM role for the Lambda function associated with the custom resource that sets the retention policy. This parameter is required.this
public DatabaseCluster.Builder dbClusterName(java.lang.String dbClusterName)
Default: - A name is automatically generated.
dbClusterName
- An optional identifier for the cluster. This parameter is required.this
public DatabaseCluster.Builder deletionProtection(java.lang.Boolean deletionProtection)
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
deletionProtection
- Specifies whether this cluster can be deleted. This parameter is required.this
public DatabaseCluster.Builder engineVersion(java.lang.String engineVersion)
Default: - The default engine version.
engineVersion
- What version of the database to start. This parameter is required.this
public DatabaseCluster.Builder exportAuditLogsToCloudWatch(java.lang.Boolean exportAuditLogsToCloudWatch)
Note that you also have to configure the audit log export in the Cluster's Parameter Group.
Default: false
exportAuditLogsToCloudWatch
- Whether the audit logs should be exported to CloudWatch. This parameter is required.this
https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html#event-auditing-enabling-auditing
public DatabaseCluster.Builder exportProfilerLogsToCloudWatch(java.lang.Boolean exportProfilerLogsToCloudWatch)
Note that you also have to configure the profiler log export in the Cluster's Parameter Group.
Default: false
exportProfilerLogsToCloudWatch
- Whether the profiler logs should be exported to CloudWatch. This parameter is required.this
https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html#profiling.enable-profiling
public DatabaseCluster.Builder instanceIdentifierBase(java.lang.String instanceIdentifierBase)
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.
instanceIdentifierBase
- Base identifier for instances. This parameter is required.this
public DatabaseCluster.Builder instances(java.lang.Number instances)
Default: 1
instances
- Number of DocDB compute instances. This parameter is required.this
public DatabaseCluster.Builder kmsKey(IKey kmsKey)
Default: - default master key.
kmsKey
- The KMS key for storage encryption. This parameter is required.this
public DatabaseCluster.Builder parameterGroup(IClusterParameterGroup parameterGroup)
Default: no parameter group
parameterGroup
- The DB parameter group to associate with the instance. This parameter is required.this
public DatabaseCluster.Builder port(java.lang.Number port)
Default: DatabaseCluster.DEFAULT_PORT
port
- The port the DocumentDB cluster will listen on. This parameter is required.this
public DatabaseCluster.Builder preferredMaintenanceWindow(java.lang.String preferredMaintenanceWindow)
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.
preferredMaintenanceWindow
- A weekly time range in which maintenance should preferably execute. This parameter is required.this
https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html#maintenance-window
public DatabaseCluster.Builder removalPolicy(RemovalPolicy removalPolicy)
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.
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.this
public DatabaseCluster.Builder securityGroup(ISecurityGroup securityGroup)
Default: a new security group is created.
securityGroup
- Security group. This parameter is required.this
public DatabaseCluster.Builder storageEncrypted(java.lang.Boolean storageEncrypted)
Default: true
storageEncrypted
- Whether to enable storage encryption. This parameter is required.this
public DatabaseCluster.Builder vpcSubnets(SubnetSelection vpcSubnets)
Default: private subnets
vpcSubnets
- Where to place the instances within the VPC. This parameter is required.this
public DatabaseCluster build()