Class DatabaseInstance.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseInstance>
- Enclosing class:
DatabaseInstance
DatabaseInstance
.-
Method Summary
Modifier and TypeMethodDescriptionallocatedStorage
(Number allocatedStorage) The allocated storage size, specified in gigabytes (GB).allowMajorVersionUpgrade
(Boolean allowMajorVersionUpgrade) Whether to allow major version upgrades.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()
characterSetName
(String characterSetName) For supported engines, specifies the character set to associate with the 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.static DatabaseInstance.Builder
credentials
(Credentials credentials) Credentials for the administrative user.databaseName
(String databaseName) The name of the database.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.engine
(IInstanceEngine engine) The database engine.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 for the instance.The number of I/O operations per second (IOPS) that the database provisions.licenseModel
(LicenseModel licenseModel) The license model.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.optionGroup
(IOptionGroup optionGroup) The option group to associate with the instance.parameterGroup
(IParameterGroup parameterGroup) The DB parameter group to associate with the instance.parameters
(Map<String, String> parameters) The parameters in the DBParameterGroup to create automatically.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.storageEncrypted
(Boolean storageEncrypted) Indicates whether the DB instance is encrypted.storageEncryptionKey
(IKey storageEncryptionKey) The KMS key that's used to encrypt the DB instance.storageType
(StorageType storageType) The storage type.subnetGroup
(ISubnetGroup subnetGroup) Existing subnet group for the instance.The time zone of the instance.The VPC network where the DB subnet group should be created.vpcPlacement
(SubnetSelection vpcPlacement) Deprecated.vpcSubnets
(SubnetSelection vpcSubnets) The type of subnets to add to the created DB subnet group.
-
Method Details
-
create
@Stability(Stable) public static DatabaseInstance.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
DatabaseInstance.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 DatabaseInstance.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
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
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
-
cloudwatchLogsExports
@Stability(Stable) public DatabaseInstance.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 DatabaseInstance.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 DatabaseInstance.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
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 DatabaseInstance.Builder deleteAutomatedBackups(Boolean deleteAutomatedBackups) Indicates whether automated backups should be deleted or retained when you delete a DB instance.Default: false
- Parameters:
deleteAutomatedBackups
- Indicates whether automated backups should be deleted or retained when you delete a DB instance. This parameter is required.- Returns:
this
-
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
invalid @link
DatabaseInstanceNewProps#domain
- 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 DatabaseInstance.Builder enablePerformanceInsights(Boolean enablePerformanceInsights) Whether to enable Performance Insights for the DB instance.Default: - false, unless ``performanceInsightRentention`` or ``performanceInsightEncryptionKey`` is set.
- Parameters:
enablePerformanceInsights
- Whether to enable Performance Insights for the DB instance. This parameter is required.- Returns:
this
-
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
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
- Parameters:
iops
- The number of I/O operations per second (IOPS) that the database provisions. This parameter is required.- Returns:
this
-
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
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
-
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
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 DatabaseInstance.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 DatabaseInstance.Builder performanceInsightRetention(PerformanceInsightRetention performanceInsightRetention) The amount of time, in days, to retain Performance Insights data.Default: 7
- 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 DatabaseInstance.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 DatabaseInstance.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 DatabaseInstance.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
Indicates whether the DB instance is an internet-facing instance.Default: - `true` if `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
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 DatabaseInstance.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 DatabaseInstance.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 DatabaseInstance.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
-
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
-
vpcPlacement
@Stability(Deprecated) @Deprecated public DatabaseInstance.Builder vpcPlacement(SubnetSelection vpcPlacement) Deprecated.usevpcSubnets
(deprecated) The type of subnets to add to the created DB subnet group.Default: - private subnets
- Parameters:
vpcPlacement
- The type of subnets to add to the created DB subnet group. This parameter is required.- Returns:
this
-
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
-
engine
The database engine.- Parameters:
engine
- The database engine. This parameter is required.- Returns:
this
-
allocatedStorage
The allocated storage size, specified in gigabytes (GB).Default: 100
- Parameters:
allocatedStorage
- The allocated storage size, specified in gigabytes (GB). This parameter is required.- Returns:
this
-
allowMajorVersionUpgrade
@Stability(Stable) public DatabaseInstance.Builder allowMajorVersionUpgrade(Boolean allowMajorVersionUpgrade) Whether to allow major version upgrades.Default: false
- Parameters:
allowMajorVersionUpgrade
- Whether to allow major version upgrades. This parameter is required.- Returns:
this
-
databaseName
The name of the database.Default: - no name
- Parameters:
databaseName
- The name of the database. This parameter is required.- Returns:
this
-
instanceType
The name of the compute and memory capacity for the instance.Default: - m5.large (or, more specifically, db.m5.large)
- Parameters:
instanceType
- The name of the compute and memory capacity for the instance. This parameter is required.- Returns:
this
-
licenseModel
The license model.Default: - RDS default license model
- Parameters:
licenseModel
- The license model. This parameter is required.- Returns:
this
-
parameters
The parameters in the DBParameterGroup to create automatically.You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBParameterGroup.
Default: - None
- Parameters:
parameters
- The parameters in the DBParameterGroup to create automatically. This parameter is required.- Returns:
this
-
timezone
The time zone of the instance.This is currently supported only by Microsoft Sql Server.
Default: - RDS default timezone
- Parameters:
timezone
- The time zone of the instance. This parameter is required.- Returns:
this
-
characterSetName
For supported engines, specifies the character set to associate with the DB instance.Default: - RDS default character set name
- Parameters:
characterSetName
- For supported engines, specifies the character set to associate with the DB instance. 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
-
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
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<DatabaseInstance>
- Returns:
- a newly built instance of
DatabaseInstance
.
-
vpcSubnets