Class DatabaseClusterFromSnapshot.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseClusterFromSnapshot>
- Enclosing class:
DatabaseClusterFromSnapshot
DatabaseClusterFromSnapshot
.-
Method Summary
Modifier and TypeMethodDescriptionbacktrackWindow
(Duration backtrackWindow) The number of seconds to set a cluster's target backtrack window to.backup
(BackupProps backup) Backup settings.build()
cloudwatchLogsExports
(List<String> cloudwatchLogsExports) The list of log types that need to be enabled for exporting to CloudWatch Logs.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.clusterIdentifier
(String clusterIdentifier) An optional identifier for the cluster.copyTagsToSnapshot
(Boolean copyTagsToSnapshot) Whether to copy tags to the snapshot when a snapshot is created.credentials
(Credentials credentials) Credentials for the administrative user.defaultDatabaseName
(String defaultDatabaseName) Name of a database which is automatically created inside the cluster.deletionProtection
(Boolean deletionProtection) Indicates whether the DB cluster should have deletion protection enabled.engine
(IClusterEngine engine) What kind of database to start.iamAuthentication
(Boolean iamAuthentication) Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.instanceIdentifierBase
(String instanceIdentifierBase) Base identifier for instances.instanceProps
(InstanceProps instanceProps) Settings for the individual instances that are launched.How many replicas/instances to create.monitoringInterval
(Duration monitoringInterval) The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.monitoringRole
(IRole monitoringRole) Role that will be used to manage DB instances monitoring.parameterGroup
(IParameterGroup parameterGroup) Additional parameters to pass to the database engine.parameters
(Map<String, String> parameters) The parameters in the DBClusterParameterGroup to create automatically.What port to listen on.preferredMaintenanceWindow
(String preferredMaintenanceWindow) A preferred maintenance window day/time range.removalPolicy
(RemovalPolicy removalPolicy) The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.s3ExportBuckets
(List<? extends IBucket> s3ExportBuckets) S3 buckets that you want to load data into.s3ExportRole
(IRole s3ExportRole) Role that will be associated with this DB cluster to enable S3 export.s3ImportBuckets
(List<? extends IBucket> s3ImportBuckets) S3 buckets that you want to load data from.s3ImportRole
(IRole s3ImportRole) Role that will be associated with this DB cluster to enable S3 import.snapshotIdentifier
(String snapshotIdentifier) The identifier for the DB instance snapshot or DB cluster snapshot to restore from.storageEncrypted
(Boolean storageEncrypted) Whether to enable storage encryption.storageEncryptionKey
(IKey storageEncryptionKey) The KMS key for storage encryption.subnetGroup
(ISubnetGroup subnetGroup) Existing subnet group for the cluster.
-
Method Details
-
create
@Stability(Stable) public static DatabaseClusterFromSnapshot.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
DatabaseClusterFromSnapshot.Builder
.
-
engine
What kind of database to start.- Parameters:
engine
- What kind of database to start. This parameter is required.- Returns:
this
-
instanceProps
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder instanceProps(InstanceProps instanceProps) Settings for the individual instances that are launched.- Parameters:
instanceProps
- Settings for the individual instances that are launched. This parameter is required.- Returns:
this
-
snapshotIdentifier
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder snapshotIdentifier(String snapshotIdentifier) The identifier for the DB instance snapshot or DB cluster snapshot to restore from.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.
- Parameters:
snapshotIdentifier
- The identifier for the DB instance snapshot or DB cluster snapshot to restore from. This parameter is required.- Returns:
this
-
backtrackWindow
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder backtrackWindow(Duration 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.
Default: 0 seconds (no backtrack)
- Parameters:
backtrackWindow
- The number of seconds to set a cluster's target backtrack window to. This parameter is required.- Returns:
this
- See Also:
-
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:
-
cloudwatchLogsExports
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder cloudwatchLogsExports(List<String> cloudwatchLogsExports) The list of log types that need to be enabled for exporting to CloudWatch Logs.Default: - no log exports
- Parameters:
cloudwatchLogsExports
- The list of log types that need to be enabled for exporting to CloudWatch Logs. This parameter is required.- Returns:
this
-
cloudwatchLogsRetention
@Stability(Stable) public DatabaseClusterFromSnapshot.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 DatabaseClusterFromSnapshot.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
-
clusterIdentifier
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder clusterIdentifier(String clusterIdentifier) An optional identifier for the cluster.Default: - A name is automatically generated.
- Parameters:
clusterIdentifier
- An optional identifier for the cluster. This parameter is required.- Returns:
this
-
copyTagsToSnapshot
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder copyTagsToSnapshot(Boolean copyTagsToSnapshot) Whether to copy tags to the snapshot when a snapshot is created.Default: - true
- Parameters:
copyTagsToSnapshot
- Whether to copy tags to the snapshot when a snapshot is created. This parameter is required.- Returns:
this
-
credentials
Credentials for the administrative user.Default: - A username of 'admin' (or 'postgres' for PostgreSQL) and SecretsManager-generated password
- Parameters:
credentials
- Credentials for the administrative user. This parameter is required.- Returns:
this
-
defaultDatabaseName
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder defaultDatabaseName(String defaultDatabaseName) Name of a database which is automatically created inside the cluster.Default: - Database is not created in cluster.
- Parameters:
defaultDatabaseName
- Name of a database which is automatically created inside the cluster. This parameter is required.- Returns:
this
-
deletionProtection
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder deletionProtection(Boolean deletionProtection) Indicates whether the DB cluster should have deletion protection enabled.Default: - true if ``removalPolicy`` is RETAIN, false otherwise
- Parameters:
deletionProtection
- Indicates whether the DB cluster should have deletion protection enabled. This parameter is required.- Returns:
this
-
iamAuthentication
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder iamAuthentication(Boolean iamAuthentication) Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.Default: false
- Parameters:
iamAuthentication
- Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. This parameter is required.- Returns:
this
-
instanceIdentifierBase
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder instanceIdentifierBase(String instanceIdentifierBase) Base identifier for instances.Every replica is named by appending the replica number to this string, 1-based.
Default: - clusterIdentifier is used with the word "Instance" appended. If clusterIdentifier is not provided, the identifier is automatically generated.
- Parameters:
instanceIdentifierBase
- Base identifier for instances. This parameter is required.- Returns:
this
-
instances
How many replicas/instances to create.Has to be at least 1.
Default: 2
- Parameters:
instances
- How many replicas/instances to create. This parameter is required.- Returns:
this
-
monitoringInterval
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder monitoringInterval(Duration monitoringInterval) The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.Default: no enhanced monitoring
- Parameters:
monitoringInterval
- The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances. This parameter is required.- Returns:
this
-
monitoringRole
Role that will be used to manage DB instances monitoring.Default: - A role is automatically created for you
- Parameters:
monitoringRole
- Role that will be used to manage DB instances monitoring. This parameter is required.- Returns:
this
-
parameterGroup
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder parameterGroup(IParameterGroup parameterGroup) Additional parameters to pass to the database engine.Default: - No parameter group.
- Parameters:
parameterGroup
- Additional parameters to pass to the database engine. This parameter is required.- Returns:
this
-
parameters
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder parameters(Map<String, String> 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.
Default: - None
- Parameters:
parameters
- The parameters in the DBClusterParameterGroup to create automatically. This parameter is required.- Returns:
this
-
port
What port to listen on.Default: - The default for the engine is used.
- Parameters:
port
- What port to listen on. This parameter is required.- Returns:
this
-
preferredMaintenanceWindow
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder preferredMaintenanceWindow(String 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'
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 preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). This parameter is required.- Returns:
this
- See Also:
-
removalPolicy
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder removalPolicy(RemovalPolicy removalPolicy) The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.Default: - RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)
- Parameters:
removalPolicy
- The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. This parameter is required.- Returns:
this
-
s3ExportBuckets
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder s3ExportBuckets(List<? extends IBucket> 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 if
s3ExportRole
is used.For MySQL:
Default: - None
- Parameters:
s3ExportBuckets
- S3 buckets that you want to load data into. This feature is only supported by the Aurora database engine. This parameter is required.- Returns:
this
- See Also:
-
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:
Default: - New role is created if `s3ExportBuckets` is set, no role is defined otherwise
- Parameters:
s3ExportRole
- Role that will be associated with this DB cluster to enable S3 export. This parameter is required.- Returns:
this
- See Also:
-
s3ImportBuckets
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder s3ImportBuckets(List<? extends IBucket> 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 if
s3ImportRole
is used.For MySQL:
Default: - None
- Parameters:
s3ImportBuckets
- S3 buckets that you want to load data from. This feature is only supported by the Aurora database engine. This parameter is required.- Returns:
this
- See Also:
-
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:
Default: - New role is created if `s3ImportBuckets` is set, no role is defined otherwise
- Parameters:
s3ImportRole
- Role that will be associated with this DB cluster to enable S3 import. This parameter is required.- Returns:
this
- See Also:
-
storageEncrypted
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder storageEncrypted(Boolean storageEncrypted) Whether to enable storage encryption.Default: - true if storageEncryptionKey is provided, false otherwise
- Parameters:
storageEncrypted
- Whether to enable storage encryption. This parameter is required.- Returns:
this
-
storageEncryptionKey
@Stability(Stable) public DatabaseClusterFromSnapshot.Builder storageEncryptionKey(IKey storageEncryptionKey) The KMS key for storage encryption.If specified,
storageEncrypted(java.lang.Boolean)
will be set to `true`.Default: - if storageEncrypted is true then the default master key, no key otherwise
- Parameters:
storageEncryptionKey
- The KMS key for storage encryption. This parameter is required.- Returns:
this
-
subnetGroup
Existing subnet group for the cluster.Default: - a new subnet group will be created.
- Parameters:
subnetGroup
- Existing subnet group for the cluster. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DatabaseClusterFromSnapshot>
- Returns:
- a newly built instance of
DatabaseClusterFromSnapshot
.
-