Class DatabaseInstanceReadReplica.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseInstanceReadReplica>
- Enclosing class:
DatabaseInstanceReadReplica
DatabaseInstanceReadReplica
.-
Method Summary
Modifier and TypeMethodDescriptionallocatedStorage
(Number allocatedStorage) The allocated storage size, specified in gibibytes (GiB).autoMinorVersionUpgrade
(Boolean autoMinorVersionUpgrade) Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.availabilityZone
(String availabilityZone) The name of the Availability Zone where the DB instance will be located.backupRetention
(Duration backupRetention) The number of days during which automatic DB snapshots are retained.build()
caCertificate
(CaCertificate caCertificate) The identifier of the CA certificate for this DB instance.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.copyTagsToSnapshot
(Boolean copyTagsToSnapshot) Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.deleteAutomatedBackups
(Boolean deleteAutomatedBackups) Indicates whether automated backups should be deleted or retained when you delete a DB instance.deletionProtection
(Boolean deletionProtection) Indicates whether the DB instance should have deletion protection enabled.The Active Directory directory ID to create the DB instance in.domainRole
(IRole domainRole) The IAM role to be used when making API calls to the Directory Service.enablePerformanceInsights
(Boolean enablePerformanceInsights) Whether to enable Performance Insights for the DB instance.iamAuthentication
(Boolean iamAuthentication) Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.instanceIdentifier
(String instanceIdentifier) A name for the DB instance.instanceType
(InstanceType instanceType) The name of the compute and memory capacity classes.The number of I/O operations per second (IOPS) that the database provisions.maxAllocatedStorage
(Number maxAllocatedStorage) Upper limit to which RDS can scale the storage in GiB(Gibibyte).monitoringInterval
(Duration monitoringInterval) The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.monitoringRole
(IRole monitoringRole) Role that will be used to manage DB instance monitoring.Specifies if the database instance is a multiple Availability Zone deployment.networkType
(NetworkType networkType) The network type of the DB instance.optionGroup
(IOptionGroup optionGroup) The option group to associate with the instance.parameterGroup
(IParameterGroup parameterGroup) The DB parameter group to associate with the instance.performanceInsightEncryptionKey
(IKey performanceInsightEncryptionKey) The AWS KMS key for encryption of Performance Insights data.performanceInsightRetention
(PerformanceInsightRetention performanceInsightRetention) The amount of time, in days, to retain Performance Insights data.The port for the instance.preferredBackupWindow
(String preferredBackupWindow) The daily time range during which automated backups are performed.preferredMaintenanceWindow
(String preferredMaintenanceWindow) The weekly time range (in UTC) during which system maintenance can occur.processorFeatures
(ProcessorFeatures processorFeatures) The number of CPU cores and the number of threads per core.publiclyAccessible
(Boolean publiclyAccessible) Indicates whether the DB instance is an internet-facing instance.removalPolicy
(RemovalPolicy removalPolicy) The CloudFormation policy to apply when the instance is 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 instance 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 instance to enable S3 import.securityGroups
(List<? extends ISecurityGroup> securityGroups) The security groups to assign to the DB instance.sourceDatabaseInstance
(IDatabaseInstance sourceDatabaseInstance) The source database instance.storageEncrypted
(Boolean storageEncrypted) Indicates whether the DB instance is encrypted.storageEncryptionKey
(IKey storageEncryptionKey) The KMS key that's used to encrypt the DB instance.storageThroughput
(Number storageThroughput) The storage throughput, specified in mebibytes per second (MiBps).storageType
(StorageType storageType) The storage type.subnetGroup
(ISubnetGroup subnetGroup) Existing subnet group for the instance.The VPC network where the DB subnet group should be created.vpcSubnets
(SubnetSelection vpcSubnets) The type of subnets to add to the created DB subnet group.
-
Method Details
-
create
@Stability(Stable) public static DatabaseInstanceReadReplica.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
DatabaseInstanceReadReplica.Builder
.
-
vpc
The VPC network where the DB subnet group should be created.- Parameters:
vpc
- The VPC network where the DB subnet group should be created. This parameter is required.- Returns:
this
-
autoMinorVersionUpgrade
@Stability(Stable) public DatabaseInstanceReadReplica.Builder autoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade) Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.Default: true
- Parameters:
autoMinorVersionUpgrade
- Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window. This parameter is required.- Returns:
this
-
availabilityZone
@Stability(Stable) public DatabaseInstanceReadReplica.Builder availabilityZone(String availabilityZone) The name of the Availability Zone where the DB instance will be located.Default: - no preference
- Parameters:
availabilityZone
- The name of the Availability Zone where the DB instance will be located. This parameter is required.- Returns:
this
-
backupRetention
@Stability(Stable) public DatabaseInstanceReadReplica.Builder backupRetention(Duration backupRetention) The number of days during which automatic DB snapshots are retained.Set to zero to disable backups. When creating a read replica, you must enable automatic backups on the source database instance by setting the backup retention to a value other than zero.
Default: - Duration.days(1) for source instances, disabled for read replicas
- Parameters:
backupRetention
- The number of days during which automatic DB snapshots are retained. This parameter is required.- Returns:
this
-
caCertificate
@Stability(Stable) public DatabaseInstanceReadReplica.Builder caCertificate(CaCertificate caCertificate) The identifier of the CA certificate for this DB instance.Specifying or updating this property triggers a reboot.
For RDS DB engines:
Default: - RDS will choose a certificate authority
- Parameters:
caCertificate
- The identifier of the CA certificate for this DB instance. This parameter is required.- Returns:
this
- See Also:
-
cloudwatchLogsExports
@Stability(Stable) public DatabaseInstanceReadReplica.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 DatabaseInstanceReadReplica.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 DatabaseInstanceReadReplica.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
-
copyTagsToSnapshot
@Stability(Stable) public DatabaseInstanceReadReplica.Builder copyTagsToSnapshot(Boolean copyTagsToSnapshot) Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.Default: true
- Parameters:
copyTagsToSnapshot
- Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. This parameter is required.- Returns:
this
-
deleteAutomatedBackups
@Stability(Stable) public DatabaseInstanceReadReplica.Builder deleteAutomatedBackups(Boolean deleteAutomatedBackups) Indicates whether automated backups should be deleted or retained when you delete a DB instance.Default: true
- Parameters:
deleteAutomatedBackups
- Indicates whether automated backups should be deleted or retained when you delete a DB instance. This parameter is required.- Returns:
this
-
deletionProtection
@Stability(Stable) public DatabaseInstanceReadReplica.Builder deletionProtection(Boolean deletionProtection) Indicates whether the DB instance should have deletion protection enabled.Default: - true if ``removalPolicy`` is RETAIN, false otherwise
- Parameters:
deletionProtection
- Indicates whether the DB instance should have deletion protection enabled. This parameter is required.- Returns:
this
-
domain
The Active Directory directory ID to create the DB instance in.Default: - Do not join domain
- Parameters:
domain
- The Active Directory directory ID to create the DB instance in. This parameter is required.- Returns:
this
-
domainRole
The IAM role to be used when making API calls to the Directory Service.The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.
Default: - The role will be created for you if `DatabaseInstanceNewProps#domain` is specified
- Parameters:
domainRole
- The IAM role to be used when making API calls to the Directory Service. This parameter is required.- Returns:
this
-
enablePerformanceInsights
@Stability(Stable) public DatabaseInstanceReadReplica.Builder enablePerformanceInsights(Boolean enablePerformanceInsights) Whether to enable Performance Insights for the DB instance.Default: - false, unless ``performanceInsightRetention`` or ``performanceInsightEncryptionKey`` is set.
- Parameters:
enablePerformanceInsights
- Whether to enable Performance Insights for the DB instance. This parameter is required.- Returns:
this
-
iamAuthentication
@Stability(Stable) public DatabaseInstanceReadReplica.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
-
instanceIdentifier
@Stability(Stable) public DatabaseInstanceReadReplica.Builder instanceIdentifier(String instanceIdentifier) A name for the DB instance.If you specify a name, AWS CloudFormation converts it to lowercase.
Default: - a CloudFormation generated name
- Parameters:
instanceIdentifier
- A name for the DB instance. This parameter is required.- Returns:
this
-
iops
The number of I/O operations per second (IOPS) that the database provisions.The value must be equal to or greater than 1000.
Default: - no provisioned iops if storage type is not specified. For GP3: 3,000 IOPS if allocated storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL, less than 200 GiB for Oracle and less than 20 GiB for SQL Server. 12,000 IOPS otherwise (except for SQL Server where the default is always 3,000 IOPS).
- Parameters:
iops
- The number of I/O operations per second (IOPS) that the database provisions. This parameter is required.- Returns:
this
-
maxAllocatedStorage
@Stability(Stable) public DatabaseInstanceReadReplica.Builder maxAllocatedStorage(Number maxAllocatedStorage) Upper limit to which RDS can scale the storage in GiB(Gibibyte).Default: - No autoscaling of RDS instance
- Parameters:
maxAllocatedStorage
- Upper limit to which RDS can scale the storage in GiB(Gibibyte). This parameter is required.- Returns:
this
- See Also:
-
monitoringInterval
@Stability(Stable) public DatabaseInstanceReadReplica.Builder monitoringInterval(Duration monitoringInterval) The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.Default: - no enhanced monitoring
- Parameters:
monitoringInterval
- The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance. This parameter is required.- Returns:
this
-
monitoringRole
Role that will be used to manage DB instance monitoring.Default: - A role is automatically created for you
- Parameters:
monitoringRole
- Role that will be used to manage DB instance monitoring. This parameter is required.- Returns:
this
-
multiAz
Specifies if the database instance is a multiple Availability Zone deployment.Default: false
- Parameters:
multiAz
- Specifies if the database instance is a multiple Availability Zone deployment. This parameter is required.- Returns:
this
-
networkType
The network type of the DB instance.Default: - IPV4
- Parameters:
networkType
- The network type of the DB instance. This parameter is required.- Returns:
this
-
optionGroup
The option group to associate with the instance.Default: - no option group
- Parameters:
optionGroup
- The option group to associate with the instance. This parameter is required.- Returns:
this
-
parameterGroup
@Stability(Stable) public DatabaseInstanceReadReplica.Builder parameterGroup(IParameterGroup 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
-
performanceInsightEncryptionKey
@Stability(Stable) public DatabaseInstanceReadReplica.Builder performanceInsightEncryptionKey(IKey performanceInsightEncryptionKey) The AWS KMS key for encryption of Performance Insights data.Default: - default master key
- Parameters:
performanceInsightEncryptionKey
- The AWS KMS key for encryption of Performance Insights data. This parameter is required.- Returns:
this
-
performanceInsightRetention
@Stability(Stable) public DatabaseInstanceReadReplica.Builder performanceInsightRetention(PerformanceInsightRetention performanceInsightRetention) The amount of time, in days, to retain Performance Insights data.Default: 7 this is the free tier
- Parameters:
performanceInsightRetention
- The amount of time, in days, to retain Performance Insights data. This parameter is required.- Returns:
this
-
port
The port for the instance.Default: - the default port for the chosen engine.
- Parameters:
port
- The port for the instance. This parameter is required.- Returns:
this
-
preferredBackupWindow
@Stability(Stable) public DatabaseInstanceReadReplica.Builder preferredBackupWindow(String preferredBackupWindow) The daily time range during which automated backups are performed.Constraints:
- Must be in the format
hh24:mi-hh24:mi
. - Must be in Universal Coordinated Time (UTC).
- Must not conflict with the preferred maintenance window.
- Must be at least 30 minutes.
Default: - a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow
- Parameters:
preferredBackupWindow
- The daily time range during which automated backups are performed. This parameter is required.- Returns:
this
- Must be in the format
-
preferredMaintenanceWindow
@Stability(Stable) public DatabaseInstanceReadReplica.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) The weekly time range (in UTC) during which system maintenance can occur.Format:
ddd:hh24:mi-ddd:hh24:mi
Constraint: Minimum 30-minute windowDefault: - 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. To see the time blocks available, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance
- Parameters:
preferredMaintenanceWindow
- The weekly time range (in UTC) during which system maintenance can occur. This parameter is required.- Returns:
this
-
processorFeatures
@Stability(Stable) public DatabaseInstanceReadReplica.Builder processorFeatures(ProcessorFeatures processorFeatures) The number of CPU cores and the number of threads per core.Default: - the default number of CPU cores and threads per core for the chosen instance class. See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#USER_ConfigureProcessor
- Parameters:
processorFeatures
- The number of CPU cores and the number of threads per core. This parameter is required.- Returns:
this
-
publiclyAccessible
@Stability(Stable) public DatabaseInstanceReadReplica.Builder publiclyAccessible(Boolean publiclyAccessible) Indicates whether the DB instance is an internet-facing instance.If not specified, the instance's vpcSubnets will be used to determine if the instance is internet-facing or not.
Default: - `true` if the instance's `vpcSubnets` is `subnetType: SubnetType.PUBLIC`, `false` otherwise
- Parameters:
publiclyAccessible
- Indicates whether the DB instance is an internet-facing instance. This parameter is required.- Returns:
this
-
removalPolicy
@Stability(Stable) public DatabaseInstanceReadReplica.Builder removalPolicy(RemovalPolicy removalPolicy) The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.Default: - RemovalPolicy.SNAPSHOT (remove the resource, but retain a snapshot of the data)
- Parameters:
removalPolicy
- The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. This parameter is required.- Returns:
this
-
s3ExportBuckets
@Stability(Stable) public DatabaseInstanceReadReplica.Builder s3ExportBuckets(List<? extends IBucket> s3ExportBuckets) S3 buckets that you want to load data into.This property must not be used if
s3ExportRole
is used.For Microsoft SQL Server:
Default: - None
- Parameters:
s3ExportBuckets
- S3 buckets that you want to load data into. This parameter is required.- Returns:
this
- See Also:
-
s3ExportRole
Role that will be associated with this DB instance to enable S3 export.This property must not be used if
s3ExportBuckets
is used.For Microsoft SQL Server:
Default: - New role is created if `s3ExportBuckets` is set, no role is defined otherwise
- Parameters:
s3ExportRole
- Role that will be associated with this DB instance to enable S3 export. This parameter is required.- Returns:
this
- See Also:
-
s3ImportBuckets
@Stability(Stable) public DatabaseInstanceReadReplica.Builder s3ImportBuckets(List<? extends IBucket> s3ImportBuckets) S3 buckets that you want to load data from.This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.
This property must not be used if
s3ImportRole
is used.For Microsoft SQL Server:
Default: - None
- Parameters:
s3ImportBuckets
- S3 buckets that you want to load data from. This parameter is required.- Returns:
this
- See Also:
-
s3ImportRole
Role that will be associated with this DB instance to enable S3 import.This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.
This property must not be used if
s3ImportBuckets
is used.For Microsoft SQL Server:
Default: - New role is created if `s3ImportBuckets` is set, no role is defined otherwise
- Parameters:
s3ImportRole
- Role that will be associated with this DB instance to enable S3 import. This parameter is required.- Returns:
this
- See Also:
-
securityGroups
@Stability(Stable) public DatabaseInstanceReadReplica.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) The security groups to assign to the DB instance.Default: - a new security group is created
- Parameters:
securityGroups
- The security groups to assign to the DB instance. This parameter is required.- Returns:
this
-
storageThroughput
@Stability(Stable) public DatabaseInstanceReadReplica.Builder storageThroughput(Number storageThroughput) The storage throughput, specified in mebibytes per second (MiBps).Only applicable for GP3.
Default: - 125 MiBps if allocated storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL, less than 200 GiB for Oracle and less than 20 GiB for SQL Server. 500 MiBps otherwise (except for SQL Server where the default is always 125 MiBps).
- Parameters:
storageThroughput
- The storage throughput, specified in mebibytes per second (MiBps). This parameter is required.- Returns:
this
- See Also:
-
storageType
The storage type.Storage types supported are gp2, io1, standard.
Default: GP2
- Parameters:
storageType
- The storage type. This parameter is required.- Returns:
this
- See Also:
-
subnetGroup
Existing subnet group for the instance.Default: - a new subnet group will be created.
- Parameters:
subnetGroup
- Existing subnet group for the instance. This parameter is required.- Returns:
this
-
vpcSubnets
@Stability(Stable) public DatabaseInstanceReadReplica.Builder vpcSubnets(SubnetSelection vpcSubnets) The type of subnets to add to the created DB subnet group.Default: - private subnets
- Parameters:
vpcSubnets
- The type of subnets to add to the created DB subnet group. This parameter is required.- Returns:
this
-
instanceType
@Stability(Stable) public DatabaseInstanceReadReplica.Builder instanceType(InstanceType instanceType) The name of the compute and memory capacity classes.- Parameters:
instanceType
- The name of the compute and memory capacity classes. This parameter is required.- Returns:
this
-
sourceDatabaseInstance
@Stability(Stable) public DatabaseInstanceReadReplica.Builder sourceDatabaseInstance(IDatabaseInstance sourceDatabaseInstance) The source database instance.Each DB instance can have a limited number of read replicas. For more information, see https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/USER_ReadRepl.html.
- Parameters:
sourceDatabaseInstance
- The source database instance. This parameter is required.- Returns:
this
-
allocatedStorage
@Stability(Stable) public DatabaseInstanceReadReplica.Builder allocatedStorage(Number allocatedStorage) The allocated storage size, specified in gibibytes (GiB).Default: - The replica will inherit the allocated storage of the source database instance
- Parameters:
allocatedStorage
- The allocated storage size, specified in gibibytes (GiB). This parameter is required.- Returns:
this
-
storageEncrypted
@Stability(Stable) public DatabaseInstanceReadReplica.Builder storageEncrypted(Boolean storageEncrypted) Indicates whether the DB instance is encrypted.Default: - true if storageEncryptionKey has been provided, false otherwise
- Parameters:
storageEncrypted
- Indicates whether the DB instance is encrypted. This parameter is required.- Returns:
this
-
storageEncryptionKey
@Stability(Stable) public DatabaseInstanceReadReplica.Builder storageEncryptionKey(IKey storageEncryptionKey) The KMS key that's used to encrypt the DB instance.Default: - default master key if storageEncrypted is true, no key otherwise
- Parameters:
storageEncryptionKey
- The KMS key that's used to encrypt the DB instance. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DatabaseInstanceReadReplica>
- Returns:
- a newly built instance of
DatabaseInstanceReadReplica
.
-