Class DatabaseCluster.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseCluster>
- Enclosing class:
DatabaseCluster
DatabaseCluster
.-
Method Summary
Modifier and TypeMethodDescriptionbackup
(BackupProps backup) Backup settings.build()
cloudWatchLogsRetention
(RetentionDays cloudWatchLogsRetention) The number of days log events are kept in CloudWatch Logs.cloudWatchLogsRetentionRole
(IRole cloudWatchLogsRetentionRole) The IAM role for the Lambda function associated with the custom resource that sets the retention policy.static DatabaseCluster.Builder
dbClusterName
(String dbClusterName) An optional identifier for the cluster.deletionProtection
(Boolean deletionProtection) Specifies whether this cluster can be deleted.engineVersion
(String engineVersion) What version of the database to start.exportAuditLogsToCloudWatch
(Boolean exportAuditLogsToCloudWatch) Whether the audit logs should be exported to CloudWatch.exportProfilerLogsToCloudWatch
(Boolean exportProfilerLogsToCloudWatch) Whether the profiler logs should be exported to CloudWatch.instanceIdentifierBase
(String instanceIdentifierBase) Base identifier for instances.Number of DocDB compute instances.instanceType
(InstanceType instanceType) What type of instance to start for the replicas.The KMS key for storage encryption.masterUser
(Login masterUser) Username and password for the administrative user.parameterGroup
(IClusterParameterGroup parameterGroup) The DB parameter group to associate with the instance.The port the DocumentDB cluster will listen on.preferredMaintenanceWindow
(String preferredMaintenanceWindow) A weekly time range in which maintenance should preferably execute.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.securityGroup
(ISecurityGroup securityGroup) Security group.storageEncrypted
(Boolean storageEncrypted) Whether to enable storage encryption.What subnets to run the DocumentDB instances in.vpcSubnets
(SubnetSelection vpcSubnets) Where to place the instances within the VPC.
-
Method Details
-
create
@Stability(Stable) 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
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
-
masterUser
Username and password for the administrative user.- Parameters:
masterUser
- Username and password for the administrative user. This parameter is required.- Returns:
this
-
vpc
What subnets to run the DocumentDB instances in.Must be at least 2 subnets in two different AZs.
- Parameters:
vpc
- What subnets to run the DocumentDB instances in. This parameter is required.- Returns:
this
-
backup
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.
- Parameters:
backup
- Backup settings. This parameter is required.- Returns:
this
- See Also:
-
cloudWatchLogsRetention
@Stability(Stable) public DatabaseCluster.Builder cloudWatchLogsRetention(RetentionDays cloudWatchLogsRetention) 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
- Parameters:
cloudWatchLogsRetention
- The number of days log events are kept in CloudWatch Logs. This parameter is required.- Returns:
this
-
cloudWatchLogsRetentionRole
@Stability(Stable) public DatabaseCluster.Builder cloudWatchLogsRetentionRole(IRole cloudWatchLogsRetentionRole) The IAM role for the Lambda function associated with the custom resource that sets the retention policy.Default: - a new role is created.
- Parameters:
cloudWatchLogsRetentionRole
- The IAM role for the Lambda function associated with the custom resource that sets the retention policy. This parameter is required.- Returns:
this
-
dbClusterName
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
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
- Parameters:
deletionProtection
- Specifies whether this cluster can be deleted. This parameter is required.- Returns:
this
-
engineVersion
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
-
exportAuditLogsToCloudWatch
@Stability(Stable) public DatabaseCluster.Builder exportAuditLogsToCloudWatch(Boolean exportAuditLogsToCloudWatch) 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
- Parameters:
exportAuditLogsToCloudWatch
- Whether the audit logs should be exported to CloudWatch. This parameter is required.- Returns:
this
- See Also:
-
exportProfilerLogsToCloudWatch
@Stability(Stable) public DatabaseCluster.Builder exportProfilerLogsToCloudWatch(Boolean exportProfilerLogsToCloudWatch) 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
- Parameters:
exportProfilerLogsToCloudWatch
- Whether the profiler logs should be exported to CloudWatch. This parameter is required.- Returns:
this
- See Also:
-
instanceIdentifierBase
@Stability(Stable) public DatabaseCluster.Builder instanceIdentifierBase(String instanceIdentifierBase) 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
Number of DocDB compute instances.Default: 1
- Parameters:
instances
- Number of DocDB compute instances. This parameter is required.- Returns:
this
-
kmsKey
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(Stable) public DatabaseCluster.Builder parameterGroup(IClusterParameterGroup parameterGroup) 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
The port the DocumentDB cluster will listen on.Default: DatabaseCluster.DEFAULT_PORT
- Parameters:
port
- The port the DocumentDB cluster will listen on. This parameter is required.- Returns:
this
-
preferredMaintenanceWindow
@Stability(Stable) public DatabaseCluster.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) 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
- See Also:
-
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 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
-
securityGroup
Security group.Default: a new security group is created.
- Parameters:
securityGroup
- Security group. This parameter is required.- Returns:
this
-
storageEncrypted
Whether to enable storage encryption.Default: true
- Parameters:
storageEncrypted
- Whether to enable storage encryption. This parameter is required.- Returns:
this
-
vpcSubnets
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
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DatabaseCluster>
- Returns:
- a newly built instance of
DatabaseCluster
.
-