Class DatabaseClusterProps.Builder
java.lang.Object
software.amazon.awscdk.services.docdb.DatabaseClusterProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseClusterProps>
- Enclosing interface:
DatabaseClusterProps
@Stability(Stable)
public static final class DatabaseClusterProps.Builder
extends Object
implements software.amazon.jsii.Builder<DatabaseClusterProps>
A builder for
DatabaseClusterProps
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackup
(BackupProps backup) Sets the value ofDatabaseClusterProps.getBackup()
build()
Builds the configured instance.cloudWatchLogsRetention
(RetentionDays cloudWatchLogsRetention) Sets the value ofDatabaseClusterProps.getCloudWatchLogsRetention()
cloudWatchLogsRetentionRole
(IRole cloudWatchLogsRetentionRole) Sets the value ofDatabaseClusterProps.getCloudWatchLogsRetentionRole()
dbClusterName
(String dbClusterName) Sets the value ofDatabaseClusterProps.getDbClusterName()
deletionProtection
(Boolean deletionProtection) Sets the value ofDatabaseClusterProps.getDeletionProtection()
engineVersion
(String engineVersion) Sets the value ofDatabaseClusterProps.getEngineVersion()
exportAuditLogsToCloudWatch
(Boolean exportAuditLogsToCloudWatch) Sets the value ofDatabaseClusterProps.getExportAuditLogsToCloudWatch()
exportProfilerLogsToCloudWatch
(Boolean exportProfilerLogsToCloudWatch) Sets the value ofDatabaseClusterProps.getExportProfilerLogsToCloudWatch()
instanceIdentifierBase
(String instanceIdentifierBase) Sets the value ofDatabaseClusterProps.getInstanceIdentifierBase()
Sets the value ofDatabaseClusterProps.getInstances()
instanceType
(InstanceType instanceType) Sets the value ofDatabaseClusterProps.getInstanceType()
Sets the value ofDatabaseClusterProps.getKmsKey()
masterUser
(Login masterUser) Sets the value ofDatabaseClusterProps.getMasterUser()
parameterGroup
(IClusterParameterGroup parameterGroup) Sets the value ofDatabaseClusterProps.getParameterGroup()
Sets the value ofDatabaseClusterProps.getPort()
preferredMaintenanceWindow
(String preferredMaintenanceWindow) Sets the value ofDatabaseClusterProps.getPreferredMaintenanceWindow()
removalPolicy
(RemovalPolicy removalPolicy) Sets the value ofDatabaseClusterProps.getRemovalPolicy()
securityGroup
(ISecurityGroup securityGroup) Sets the value ofDatabaseClusterProps.getSecurityGroup()
storageEncrypted
(Boolean storageEncrypted) Sets the value ofDatabaseClusterProps.getStorageEncrypted()
Sets the value ofDatabaseClusterProps.getVpc()
vpcSubnets
(SubnetSelection vpcSubnets) Sets the value ofDatabaseClusterProps.getVpcSubnets()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
instanceType
Sets the value ofDatabaseClusterProps.getInstanceType()
- Parameters:
instanceType
- What type of instance to start for the replicas. This parameter is required.- Returns:
this
-
masterUser
Sets the value ofDatabaseClusterProps.getMasterUser()
- Parameters:
masterUser
- Username and password for the administrative user. This parameter is required.- Returns:
this
-
vpc
Sets the value ofDatabaseClusterProps.getVpc()
- Parameters:
vpc
- What subnets to run the DocumentDB instances in. This parameter is required. Must be at least 2 subnets in two different AZs.- Returns:
this
-
backup
Sets the value ofDatabaseClusterProps.getBackup()
- Parameters:
backup
- Backup settings.- Returns:
this
-
cloudWatchLogsRetention
@Stability(Stable) public DatabaseClusterProps.Builder cloudWatchLogsRetention(RetentionDays cloudWatchLogsRetention) Sets the value ofDatabaseClusterProps.getCloudWatchLogsRetention()
- Parameters:
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 toInfinity
.- Returns:
this
-
cloudWatchLogsRetentionRole
@Stability(Stable) public DatabaseClusterProps.Builder cloudWatchLogsRetentionRole(IRole cloudWatchLogsRetentionRole) Sets the value ofDatabaseClusterProps.getCloudWatchLogsRetentionRole()
- Parameters:
cloudWatchLogsRetentionRole
- The IAM role for the Lambda function associated with the custom resource that sets the retention policy.- Returns:
this
-
dbClusterName
Sets the value ofDatabaseClusterProps.getDbClusterName()
- Parameters:
dbClusterName
- An optional identifier for the cluster.- Returns:
this
-
deletionProtection
@Stability(Stable) public DatabaseClusterProps.Builder deletionProtection(Boolean deletionProtection) Sets the value ofDatabaseClusterProps.getDeletionProtection()
- Parameters:
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.- Returns:
this
-
engineVersion
Sets the value ofDatabaseClusterProps.getEngineVersion()
- Parameters:
engineVersion
- What version of the database to start.- Returns:
this
-
exportAuditLogsToCloudWatch
@Stability(Stable) public DatabaseClusterProps.Builder exportAuditLogsToCloudWatch(Boolean exportAuditLogsToCloudWatch) Sets the value ofDatabaseClusterProps.getExportAuditLogsToCloudWatch()
- Parameters:
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.- Returns:
this
-
exportProfilerLogsToCloudWatch
@Stability(Stable) public DatabaseClusterProps.Builder exportProfilerLogsToCloudWatch(Boolean exportProfilerLogsToCloudWatch) Sets the value ofDatabaseClusterProps.getExportProfilerLogsToCloudWatch()
- Parameters:
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.- Returns:
this
-
instanceIdentifierBase
@Stability(Stable) public DatabaseClusterProps.Builder instanceIdentifierBase(String instanceIdentifierBase) Sets the value ofDatabaseClusterProps.getInstanceIdentifierBase()
- Parameters:
instanceIdentifierBase
- Base identifier for instances. Every replica is named by appending the replica number to this string, 1-based.- Returns:
this
-
instances
Sets the value ofDatabaseClusterProps.getInstances()
- Parameters:
instances
- Number of DocDB compute instances.- Returns:
this
-
kmsKey
Sets the value ofDatabaseClusterProps.getKmsKey()
- Parameters:
kmsKey
- The KMS key for storage encryption.- Returns:
this
-
parameterGroup
@Stability(Stable) public DatabaseClusterProps.Builder parameterGroup(IClusterParameterGroup parameterGroup) Sets the value ofDatabaseClusterProps.getParameterGroup()
- Parameters:
parameterGroup
- The DB parameter group to associate with the instance.- Returns:
this
-
port
Sets the value ofDatabaseClusterProps.getPort()
- Parameters:
port
- The port the DocumentDB cluster will listen on.- Returns:
this
-
preferredMaintenanceWindow
@Stability(Stable) public DatabaseClusterProps.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) Sets the value ofDatabaseClusterProps.getPreferredMaintenanceWindow()
- Parameters:
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'
- Returns:
this
-
removalPolicy
Sets the value ofDatabaseClusterProps.getRemovalPolicy()
- 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 removal policy also applies to the implicit security group created for the cluster if one is not supplied as a parameter.- Returns:
this
-
securityGroup
Sets the value ofDatabaseClusterProps.getSecurityGroup()
- Parameters:
securityGroup
- Security group.- Returns:
this
-
storageEncrypted
Sets the value ofDatabaseClusterProps.getStorageEncrypted()
- Parameters:
storageEncrypted
- Whether to enable storage encryption.- Returns:
this
-
vpcSubnets
Sets the value ofDatabaseClusterProps.getVpcSubnets()
- Parameters:
vpcSubnets
- Where to place the instances within the VPC.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DatabaseClusterProps>
- Returns:
- a new instance of
DatabaseClusterProps
- Throws:
NullPointerException
- if any required attribute was not provided
-