Class DatabaseClusterFromSnapshotProps.Builder
java.lang.Object
software.amazon.awscdk.services.rds.DatabaseClusterFromSnapshotProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseClusterFromSnapshotProps>
- Enclosing interface:
- DatabaseClusterFromSnapshotProps
@Stability(Stable)
public static final class DatabaseClusterFromSnapshotProps.Builder
extends Object
implements software.amazon.jsii.Builder<DatabaseClusterFromSnapshotProps>
A builder for
DatabaseClusterFromSnapshotProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbacktrackWindow
(Duration backtrackWindow) Sets the value ofDatabaseClusterFromSnapshotProps.getBacktrackWindow()
backup
(BackupProps backup) Sets the value ofDatabaseClusterFromSnapshotProps.getBackup()
build()
Builds the configured instance.cloudwatchLogsExports
(List<String> cloudwatchLogsExports) Sets the value ofDatabaseClusterFromSnapshotProps.getCloudwatchLogsExports()
cloudwatchLogsRetention
(RetentionDays cloudwatchLogsRetention) Sets the value ofDatabaseClusterFromSnapshotProps.getCloudwatchLogsRetention()
cloudwatchLogsRetentionRole
(IRole cloudwatchLogsRetentionRole) Sets the value ofDatabaseClusterFromSnapshotProps.getCloudwatchLogsRetentionRole()
clusterIdentifier
(String clusterIdentifier) Sets the value ofDatabaseClusterFromSnapshotProps.getClusterIdentifier()
copyTagsToSnapshot
(Boolean copyTagsToSnapshot) Sets the value ofDatabaseClusterFromSnapshotProps.getCopyTagsToSnapshot()
credentials
(Credentials credentials) Sets the value ofDatabaseClusterFromSnapshotProps.getCredentials()
defaultDatabaseName
(String defaultDatabaseName) Sets the value ofDatabaseClusterFromSnapshotProps.getDefaultDatabaseName()
deletionProtection
(Boolean deletionProtection) Sets the value ofDatabaseClusterFromSnapshotProps.getDeletionProtection()
engine
(IClusterEngine engine) Sets the value ofDatabaseClusterFromSnapshotProps.getEngine()
iamAuthentication
(Boolean iamAuthentication) Sets the value ofDatabaseClusterFromSnapshotProps.getIamAuthentication()
instanceIdentifierBase
(String instanceIdentifierBase) Sets the value ofDatabaseClusterFromSnapshotProps.getInstanceIdentifierBase()
instanceProps
(InstanceProps instanceProps) Sets the value ofDatabaseClusterFromSnapshotProps.getInstanceProps()
Sets the value ofDatabaseClusterFromSnapshotProps.getInstances()
monitoringInterval
(Duration monitoringInterval) Sets the value ofDatabaseClusterFromSnapshotProps.getMonitoringInterval()
monitoringRole
(IRole monitoringRole) Sets the value ofDatabaseClusterFromSnapshotProps.getMonitoringRole()
parameterGroup
(IParameterGroup parameterGroup) Sets the value ofDatabaseClusterFromSnapshotProps.getParameterGroup()
parameters
(Map<String, String> parameters) Sets the value ofDatabaseClusterFromSnapshotProps.getParameters()
Sets the value ofDatabaseClusterFromSnapshotProps.getPort()
preferredMaintenanceWindow
(String preferredMaintenanceWindow) Sets the value ofDatabaseClusterFromSnapshotProps.getPreferredMaintenanceWindow()
removalPolicy
(RemovalPolicy removalPolicy) Sets the value ofDatabaseClusterFromSnapshotProps.getRemovalPolicy()
s3ExportBuckets
(List<? extends IBucket> s3ExportBuckets) Sets the value ofDatabaseClusterFromSnapshotProps.getS3ExportBuckets()
s3ExportRole
(IRole s3ExportRole) Sets the value ofDatabaseClusterFromSnapshotProps.getS3ExportRole()
s3ImportBuckets
(List<? extends IBucket> s3ImportBuckets) Sets the value ofDatabaseClusterFromSnapshotProps.getS3ImportBuckets()
s3ImportRole
(IRole s3ImportRole) Sets the value ofDatabaseClusterFromSnapshotProps.getS3ImportRole()
snapshotIdentifier
(String snapshotIdentifier) Sets the value ofDatabaseClusterFromSnapshotProps.getSnapshotIdentifier()
storageEncrypted
(Boolean storageEncrypted) Sets the value ofDatabaseClusterFromSnapshotProps.getStorageEncrypted()
storageEncryptionKey
(IKey storageEncryptionKey) Sets the value ofDatabaseClusterFromSnapshotProps.getStorageEncryptionKey()
subnetGroup
(ISubnetGroup subnetGroup) Sets the value ofDatabaseClusterFromSnapshotProps.getSubnetGroup()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
engine
Sets the value ofDatabaseClusterFromSnapshotProps.getEngine()
- Parameters:
engine
- What kind of database to start. This parameter is required.- Returns:
this
-
instanceProps
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder instanceProps(InstanceProps instanceProps) Sets the value ofDatabaseClusterFromSnapshotProps.getInstanceProps()
- Parameters:
instanceProps
- Settings for the individual instances that are launched. This parameter is required.- Returns:
this
-
snapshotIdentifier
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder snapshotIdentifier(String snapshotIdentifier) Sets the value ofDatabaseClusterFromSnapshotProps.getSnapshotIdentifier()
- Parameters:
snapshotIdentifier
- The identifier for the DB instance snapshot or DB cluster snapshot to restore from. This parameter is required. You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can use only the ARN to specify a DB instance snapshot.- Returns:
this
-
backtrackWindow
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder backtrackWindow(Duration backtrackWindow) Sets the value ofDatabaseClusterFromSnapshotProps.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 ofDatabaseClusterFromSnapshotProps.getBackup()
- Parameters:
backup
- Backup settings.- Returns:
this
-
cloudwatchLogsExports
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder cloudwatchLogsExports(List<String> cloudwatchLogsExports) Sets the value ofDatabaseClusterFromSnapshotProps.getCloudwatchLogsExports()
- Parameters:
cloudwatchLogsExports
- The list of log types that need to be enabled for exporting to CloudWatch Logs.- Returns:
this
-
cloudwatchLogsRetention
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder cloudwatchLogsRetention(RetentionDays cloudwatchLogsRetention) Sets the value ofDatabaseClusterFromSnapshotProps.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 DatabaseClusterFromSnapshotProps.Builder cloudwatchLogsRetentionRole(IRole cloudwatchLogsRetentionRole) Sets the value ofDatabaseClusterFromSnapshotProps.getCloudwatchLogsRetentionRole()
- Parameters:
cloudwatchLogsRetentionRole
- The IAM role for the Lambda function associated with the custom resource that sets the retention policy.- Returns:
this
-
clusterIdentifier
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder clusterIdentifier(String clusterIdentifier) Sets the value ofDatabaseClusterFromSnapshotProps.getClusterIdentifier()
- Parameters:
clusterIdentifier
- An optional identifier for the cluster.- Returns:
this
-
copyTagsToSnapshot
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder copyTagsToSnapshot(Boolean copyTagsToSnapshot) Sets the value ofDatabaseClusterFromSnapshotProps.getCopyTagsToSnapshot()
- Parameters:
copyTagsToSnapshot
- Whether to copy tags to the snapshot when a snapshot is created.- Returns:
this
-
credentials
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder credentials(Credentials credentials) Sets the value ofDatabaseClusterFromSnapshotProps.getCredentials()
- Parameters:
credentials
- Credentials for the administrative user.- Returns:
this
-
defaultDatabaseName
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder defaultDatabaseName(String defaultDatabaseName) Sets the value ofDatabaseClusterFromSnapshotProps.getDefaultDatabaseName()
- Parameters:
defaultDatabaseName
- Name of a database which is automatically created inside the cluster.- Returns:
this
-
deletionProtection
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder deletionProtection(Boolean deletionProtection) Sets the value ofDatabaseClusterFromSnapshotProps.getDeletionProtection()
- Parameters:
deletionProtection
- Indicates whether the DB cluster should have deletion protection enabled.- Returns:
this
-
iamAuthentication
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder iamAuthentication(Boolean iamAuthentication) Sets the value ofDatabaseClusterFromSnapshotProps.getIamAuthentication()
- Parameters:
iamAuthentication
- Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.- Returns:
this
-
instanceIdentifierBase
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder instanceIdentifierBase(String instanceIdentifierBase) Sets the value ofDatabaseClusterFromSnapshotProps.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 ofDatabaseClusterFromSnapshotProps.getInstances()
- Parameters:
instances
- How many replicas/instances to create. Has to be at least 1.- Returns:
this
-
monitoringInterval
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder monitoringInterval(Duration monitoringInterval) Sets the value ofDatabaseClusterFromSnapshotProps.getMonitoringInterval()
- Parameters:
monitoringInterval
- The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.- Returns:
this
-
monitoringRole
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder monitoringRole(IRole monitoringRole) Sets the value ofDatabaseClusterFromSnapshotProps.getMonitoringRole()
- Parameters:
monitoringRole
- Role that will be used to manage DB instances monitoring.- Returns:
this
-
parameterGroup
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder parameterGroup(IParameterGroup parameterGroup) Sets the value ofDatabaseClusterFromSnapshotProps.getParameterGroup()
- Parameters:
parameterGroup
- Additional parameters to pass to the database engine.- Returns:
this
-
parameters
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder parameters(Map<String, String> parameters) Sets the value ofDatabaseClusterFromSnapshotProps.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 ofDatabaseClusterFromSnapshotProps.getPort()
- Parameters:
port
- What port to listen on.- Returns:
this
-
preferredMaintenanceWindow
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) Sets the value ofDatabaseClusterFromSnapshotProps.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
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder removalPolicy(RemovalPolicy removalPolicy) Sets the value ofDatabaseClusterFromSnapshotProps.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 DatabaseClusterFromSnapshotProps.Builder s3ExportBuckets(List<? extends IBucket> s3ExportBuckets) Sets the value ofDatabaseClusterFromSnapshotProps.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 ofDatabaseClusterFromSnapshotProps.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 DatabaseClusterFromSnapshotProps.Builder s3ImportBuckets(List<? extends IBucket> s3ImportBuckets) Sets the value ofDatabaseClusterFromSnapshotProps.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 ofDatabaseClusterFromSnapshotProps.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
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder storageEncrypted(Boolean storageEncrypted) Sets the value ofDatabaseClusterFromSnapshotProps.getStorageEncrypted()
- Parameters:
storageEncrypted
- Whether to enable storage encryption.- Returns:
this
-
storageEncryptionKey
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder storageEncryptionKey(IKey storageEncryptionKey) Sets the value ofDatabaseClusterFromSnapshotProps.getStorageEncryptionKey()
- Parameters:
storageEncryptionKey
- The KMS key for storage encryption. If specified,storageEncrypted
will be set to `true`.- Returns:
this
-
subnetGroup
@Stability(Stable) public DatabaseClusterFromSnapshotProps.Builder subnetGroup(ISubnetGroup subnetGroup) Sets the value ofDatabaseClusterFromSnapshotProps.getSubnetGroup()
- Parameters:
subnetGroup
- Existing subnet group for the cluster.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DatabaseClusterFromSnapshotProps>
- Returns:
- a new instance of
DatabaseClusterFromSnapshotProps
- Throws:
NullPointerException
- if any required attribute was not provided
-