Class DatabaseClusterProps.Builder
java.lang.Object
software.amazon.awscdk.services.rds.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
-
Method Summary
Modifier and TypeMethodDescriptionbacktrackWindow
(Duration backtrackWindow) Sets the value ofDatabaseClusterProps.getBacktrackWindow()
backup
(BackupProps backup) Sets the value ofDatabaseClusterProps.getBackup()
build()
Builds the configured instance.cloudwatchLogsExports
(List<String> cloudwatchLogsExports) Sets the value ofDatabaseClusterProps.getCloudwatchLogsExports()
cloudwatchLogsRetention
(RetentionDays cloudwatchLogsRetention) Sets the value ofDatabaseClusterProps.getCloudwatchLogsRetention()
cloudwatchLogsRetentionRole
(IRole cloudwatchLogsRetentionRole) Sets the value ofDatabaseClusterProps.getCloudwatchLogsRetentionRole()
clusterIdentifier
(String clusterIdentifier) Sets the value ofDatabaseClusterProps.getClusterIdentifier()
copyTagsToSnapshot
(Boolean copyTagsToSnapshot) Sets the value ofDatabaseClusterProps.getCopyTagsToSnapshot()
credentials
(Credentials credentials) Sets the value ofDatabaseClusterProps.getCredentials()
defaultDatabaseName
(String defaultDatabaseName) Sets the value ofDatabaseClusterProps.getDefaultDatabaseName()
deletionProtection
(Boolean deletionProtection) Sets the value ofDatabaseClusterProps.getDeletionProtection()
engine
(IClusterEngine engine) Sets the value ofDatabaseClusterProps.getEngine()
iamAuthentication
(Boolean iamAuthentication) Sets the value ofDatabaseClusterProps.getIamAuthentication()
instanceIdentifierBase
(String instanceIdentifierBase) Sets the value ofDatabaseClusterProps.getInstanceIdentifierBase()
instanceProps
(InstanceProps instanceProps) Sets the value ofDatabaseClusterProps.getInstanceProps()
Sets the value ofDatabaseClusterProps.getInstances()
monitoringInterval
(Duration monitoringInterval) Sets the value ofDatabaseClusterProps.getMonitoringInterval()
monitoringRole
(IRole monitoringRole) Sets the value ofDatabaseClusterProps.getMonitoringRole()
parameterGroup
(IParameterGroup parameterGroup) Sets the value ofDatabaseClusterProps.getParameterGroup()
parameters
(Map<String, String> parameters) Sets the value ofDatabaseClusterProps.getParameters()
Sets the value ofDatabaseClusterProps.getPort()
preferredMaintenanceWindow
(String preferredMaintenanceWindow) Sets the value ofDatabaseClusterProps.getPreferredMaintenanceWindow()
removalPolicy
(RemovalPolicy removalPolicy) Sets the value ofDatabaseClusterProps.getRemovalPolicy()
s3ExportBuckets
(List<? extends IBucket> s3ExportBuckets) Sets the value ofDatabaseClusterProps.getS3ExportBuckets()
s3ExportRole
(IRole s3ExportRole) Sets the value ofDatabaseClusterProps.getS3ExportRole()
s3ImportBuckets
(List<? extends IBucket> s3ImportBuckets) Sets the value ofDatabaseClusterProps.getS3ImportBuckets()
s3ImportRole
(IRole s3ImportRole) Sets the value ofDatabaseClusterProps.getS3ImportRole()
storageEncrypted
(Boolean storageEncrypted) Sets the value ofDatabaseClusterProps.getStorageEncrypted()
storageEncryptionKey
(IKey storageEncryptionKey) Sets the value ofDatabaseClusterProps.getStorageEncryptionKey()
subnetGroup
(ISubnetGroup subnetGroup) Sets the value ofDatabaseClusterProps.getSubnetGroup()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
engine
Sets the value ofDatabaseClusterProps.getEngine()
- Parameters:
engine
- What kind of database to start. This parameter is required.- Returns:
this
-
instanceProps
Sets the value ofDatabaseClusterProps.getInstanceProps()
- Parameters:
instanceProps
- Settings for the individual instances that are launched. This parameter is required.- Returns:
this
-
backtrackWindow
Sets the value ofDatabaseClusterProps.getBacktrackWindow()
- Parameters:
backtrackWindow
- 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.- Returns:
this
-
backup
Sets the value ofDatabaseClusterProps.getBackup()
- Parameters:
backup
- Backup settings.- Returns:
this
-
cloudwatchLogsExports
@Stability(Stable) public DatabaseClusterProps.Builder cloudwatchLogsExports(List<String> cloudwatchLogsExports) Sets the value ofDatabaseClusterProps.getCloudwatchLogsExports()
- Parameters:
cloudwatchLogsExports
- The list of log types that need to be enabled for exporting to CloudWatch Logs.- 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
-
clusterIdentifier
Sets the value ofDatabaseClusterProps.getClusterIdentifier()
- Parameters:
clusterIdentifier
- An optional identifier for the cluster.- Returns:
this
-
copyTagsToSnapshot
@Stability(Stable) public DatabaseClusterProps.Builder copyTagsToSnapshot(Boolean copyTagsToSnapshot) Sets the value ofDatabaseClusterProps.getCopyTagsToSnapshot()
- Parameters:
copyTagsToSnapshot
- Whether to copy tags to the snapshot when a snapshot is created.- Returns:
this
-
credentials
Sets the value ofDatabaseClusterProps.getCredentials()
- Parameters:
credentials
- Credentials for the administrative user.- Returns:
this
-
defaultDatabaseName
@Stability(Stable) public DatabaseClusterProps.Builder defaultDatabaseName(String defaultDatabaseName) Sets the value ofDatabaseClusterProps.getDefaultDatabaseName()
- Parameters:
defaultDatabaseName
- Name of a database which is automatically created inside the cluster.- Returns:
this
-
deletionProtection
@Stability(Stable) public DatabaseClusterProps.Builder deletionProtection(Boolean deletionProtection) Sets the value ofDatabaseClusterProps.getDeletionProtection()
- Parameters:
deletionProtection
- Indicates whether the DB cluster should have deletion protection enabled.- Returns:
this
-
iamAuthentication
Sets the value ofDatabaseClusterProps.getIamAuthentication()
- Parameters:
iamAuthentication
- Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.- 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
- How many replicas/instances to create. Has to be at least 1.- Returns:
this
-
monitoringInterval
@Stability(Stable) public DatabaseClusterProps.Builder monitoringInterval(Duration monitoringInterval) Sets the value ofDatabaseClusterProps.getMonitoringInterval()
- Parameters:
monitoringInterval
- The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.- Returns:
this
-
monitoringRole
Sets the value ofDatabaseClusterProps.getMonitoringRole()
- Parameters:
monitoringRole
- Role that will be used to manage DB instances monitoring.- Returns:
this
-
parameterGroup
@Stability(Stable) public DatabaseClusterProps.Builder parameterGroup(IParameterGroup parameterGroup) Sets the value ofDatabaseClusterProps.getParameterGroup()
- Parameters:
parameterGroup
- Additional parameters to pass to the database engine.- Returns:
this
-
parameters
Sets the value ofDatabaseClusterProps.getParameters()
- Parameters:
parameters
- 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.- Returns:
this
-
port
Sets the value ofDatabaseClusterProps.getPort()
- Parameters:
port
- What port to listen on.- Returns:
this
-
preferredMaintenanceWindow
@Stability(Stable) public DatabaseClusterProps.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) Sets the value ofDatabaseClusterProps.getPreferredMaintenanceWindow()
- Parameters:
preferredMaintenanceWindow
- 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'- Returns:
this
-
removalPolicy
Sets the value ofDatabaseClusterProps.getRemovalPolicy()
- Parameters:
removalPolicy
- The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.- Returns:
this
-
s3ExportBuckets
@Stability(Stable) public DatabaseClusterProps.Builder s3ExportBuckets(List<? extends IBucket> s3ExportBuckets) Sets the value ofDatabaseClusterProps.getS3ExportBuckets()
- Parameters:
s3ExportBuckets
- 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 ifs3ExportRole
is used.For MySQL:
- Returns:
this
-
s3ExportRole
Sets the value ofDatabaseClusterProps.getS3ExportRole()
- Parameters:
s3ExportRole
- 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:
- Returns:
this
-
s3ImportBuckets
@Stability(Stable) public DatabaseClusterProps.Builder s3ImportBuckets(List<? extends IBucket> s3ImportBuckets) Sets the value ofDatabaseClusterProps.getS3ImportBuckets()
- Parameters:
s3ImportBuckets
- 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 ifs3ImportRole
is used.For MySQL:
- Returns:
this
-
s3ImportRole
Sets the value ofDatabaseClusterProps.getS3ImportRole()
- Parameters:
s3ImportRole
- 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:
- Returns:
this
-
storageEncrypted
Sets the value ofDatabaseClusterProps.getStorageEncrypted()
- Parameters:
storageEncrypted
- Whether to enable storage encryption.- Returns:
this
-
storageEncryptionKey
@Stability(Stable) public DatabaseClusterProps.Builder storageEncryptionKey(IKey storageEncryptionKey) Sets the value ofDatabaseClusterProps.getStorageEncryptionKey()
- Parameters:
storageEncryptionKey
- The KMS key for storage encryption. If specified,storageEncrypted
will be set to `true`.- Returns:
this
-
subnetGroup
Sets the value ofDatabaseClusterProps.getSubnetGroup()
- Parameters:
subnetGroup
- Existing subnet group for the cluster.- 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
-