Class DatabaseInstanceSourceProps.Builder
java.lang.Object
software.amazon.awscdk.services.rds.DatabaseInstanceSourceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseInstanceSourceProps>
- Enclosing interface:
DatabaseInstanceSourceProps
@Stability(Stable)
public static final class DatabaseInstanceSourceProps.Builder
extends Object
implements software.amazon.jsii.Builder<DatabaseInstanceSourceProps>
A builder for
DatabaseInstanceSourceProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallocatedStorage
(Number allocatedStorage) Sets the value ofDatabaseInstanceSourceProps.getAllocatedStorage()
allowMajorVersionUpgrade
(Boolean allowMajorVersionUpgrade) Sets the value ofDatabaseInstanceSourceProps.getAllowMajorVersionUpgrade()
autoMinorVersionUpgrade
(Boolean autoMinorVersionUpgrade) Sets the value ofDatabaseInstanceNewProps.getAutoMinorVersionUpgrade()
availabilityZone
(String availabilityZone) Sets the value ofDatabaseInstanceNewProps.getAvailabilityZone()
backupRetention
(Duration backupRetention) Sets the value ofDatabaseInstanceNewProps.getBackupRetention()
build()
Builds the configured instance.cloudwatchLogsExports
(List<String> cloudwatchLogsExports) Sets the value ofDatabaseInstanceNewProps.getCloudwatchLogsExports()
cloudwatchLogsRetention
(RetentionDays cloudwatchLogsRetention) Sets the value ofDatabaseInstanceNewProps.getCloudwatchLogsRetention()
cloudwatchLogsRetentionRole
(IRole cloudwatchLogsRetentionRole) Sets the value ofDatabaseInstanceNewProps.getCloudwatchLogsRetentionRole()
copyTagsToSnapshot
(Boolean copyTagsToSnapshot) Sets the value ofDatabaseInstanceNewProps.getCopyTagsToSnapshot()
databaseName
(String databaseName) Sets the value ofDatabaseInstanceSourceProps.getDatabaseName()
deleteAutomatedBackups
(Boolean deleteAutomatedBackups) Sets the value ofDatabaseInstanceNewProps.getDeleteAutomatedBackups()
deletionProtection
(Boolean deletionProtection) Sets the value ofDatabaseInstanceNewProps.getDeletionProtection()
Sets the value ofDatabaseInstanceNewProps.getDomain()
domainRole
(IRole domainRole) Sets the value ofDatabaseInstanceNewProps.getDomainRole()
enablePerformanceInsights
(Boolean enablePerformanceInsights) Sets the value ofDatabaseInstanceNewProps.getEnablePerformanceInsights()
engine
(IInstanceEngine engine) Sets the value ofDatabaseInstanceSourceProps.getEngine()
iamAuthentication
(Boolean iamAuthentication) Sets the value ofDatabaseInstanceNewProps.getIamAuthentication()
instanceIdentifier
(String instanceIdentifier) Sets the value ofDatabaseInstanceNewProps.getInstanceIdentifier()
instanceType
(InstanceType instanceType) Sets the value ofDatabaseInstanceSourceProps.getInstanceType()
Sets the value ofDatabaseInstanceNewProps.getIops()
licenseModel
(LicenseModel licenseModel) Sets the value ofDatabaseInstanceSourceProps.getLicenseModel()
maxAllocatedStorage
(Number maxAllocatedStorage) Sets the value ofDatabaseInstanceNewProps.getMaxAllocatedStorage()
monitoringInterval
(Duration monitoringInterval) Sets the value ofDatabaseInstanceNewProps.getMonitoringInterval()
monitoringRole
(IRole monitoringRole) Sets the value ofDatabaseInstanceNewProps.getMonitoringRole()
Sets the value ofDatabaseInstanceNewProps.getMultiAz()
optionGroup
(IOptionGroup optionGroup) Sets the value ofDatabaseInstanceNewProps.getOptionGroup()
parameterGroup
(IParameterGroup parameterGroup) Sets the value ofDatabaseInstanceNewProps.getParameterGroup()
parameters
(Map<String, String> parameters) Sets the value ofDatabaseInstanceSourceProps.getParameters()
performanceInsightEncryptionKey
(IKey performanceInsightEncryptionKey) Sets the value ofDatabaseInstanceNewProps.getPerformanceInsightEncryptionKey()
performanceInsightRetention
(PerformanceInsightRetention performanceInsightRetention) Sets the value ofDatabaseInstanceNewProps.getPerformanceInsightRetention()
Sets the value ofDatabaseInstanceNewProps.getPort()
preferredBackupWindow
(String preferredBackupWindow) Sets the value ofDatabaseInstanceNewProps.getPreferredBackupWindow()
preferredMaintenanceWindow
(String preferredMaintenanceWindow) Sets the value ofDatabaseInstanceNewProps.getPreferredMaintenanceWindow()
processorFeatures
(ProcessorFeatures processorFeatures) Sets the value ofDatabaseInstanceNewProps.getProcessorFeatures()
publiclyAccessible
(Boolean publiclyAccessible) Sets the value ofDatabaseInstanceNewProps.getPubliclyAccessible()
removalPolicy
(RemovalPolicy removalPolicy) Sets the value ofDatabaseInstanceNewProps.getRemovalPolicy()
s3ExportBuckets
(List<? extends IBucket> s3ExportBuckets) Sets the value ofDatabaseInstanceNewProps.getS3ExportBuckets()
s3ExportRole
(IRole s3ExportRole) Sets the value ofDatabaseInstanceNewProps.getS3ExportRole()
s3ImportBuckets
(List<? extends IBucket> s3ImportBuckets) Sets the value ofDatabaseInstanceNewProps.getS3ImportBuckets()
s3ImportRole
(IRole s3ImportRole) Sets the value ofDatabaseInstanceNewProps.getS3ImportRole()
securityGroups
(List<? extends ISecurityGroup> securityGroups) Sets the value ofDatabaseInstanceNewProps.getSecurityGroups()
storageType
(StorageType storageType) Sets the value ofDatabaseInstanceNewProps.getStorageType()
subnetGroup
(ISubnetGroup subnetGroup) Sets the value ofDatabaseInstanceNewProps.getSubnetGroup()
Sets the value ofDatabaseInstanceSourceProps.getTimezone()
Sets the value ofDatabaseInstanceNewProps.getVpc()
vpcPlacement
(SubnetSelection vpcPlacement) Deprecated.use `vpcSubnets`vpcSubnets
(SubnetSelection vpcSubnets) Sets the value ofDatabaseInstanceNewProps.getVpcSubnets()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
engine
Sets the value ofDatabaseInstanceSourceProps.getEngine()
- Parameters:
engine
- The database engine. This parameter is required.- Returns:
this
-
allocatedStorage
@Stability(Stable) public DatabaseInstanceSourceProps.Builder allocatedStorage(Number allocatedStorage) Sets the value ofDatabaseInstanceSourceProps.getAllocatedStorage()
- Parameters:
allocatedStorage
- The allocated storage size, specified in gigabytes (GB).- Returns:
this
-
allowMajorVersionUpgrade
@Stability(Stable) public DatabaseInstanceSourceProps.Builder allowMajorVersionUpgrade(Boolean allowMajorVersionUpgrade) Sets the value ofDatabaseInstanceSourceProps.getAllowMajorVersionUpgrade()
- Parameters:
allowMajorVersionUpgrade
- Whether to allow major version upgrades.- Returns:
this
-
databaseName
Sets the value ofDatabaseInstanceSourceProps.getDatabaseName()
- Parameters:
databaseName
- The name of the database.- Returns:
this
-
instanceType
@Stability(Stable) public DatabaseInstanceSourceProps.Builder instanceType(InstanceType instanceType) Sets the value ofDatabaseInstanceSourceProps.getInstanceType()
- Parameters:
instanceType
- The name of the compute and memory capacity for the instance.- Returns:
this
-
licenseModel
@Stability(Stable) public DatabaseInstanceSourceProps.Builder licenseModel(LicenseModel licenseModel) Sets the value ofDatabaseInstanceSourceProps.getLicenseModel()
- Parameters:
licenseModel
- The license model.- Returns:
this
-
parameters
@Stability(Stable) public DatabaseInstanceSourceProps.Builder parameters(Map<String, String> parameters) Sets the value ofDatabaseInstanceSourceProps.getParameters()
- Parameters:
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.- Returns:
this
-
timezone
Sets the value ofDatabaseInstanceSourceProps.getTimezone()
- Parameters:
timezone
- The time zone of the instance. This is currently supported only by Microsoft Sql Server.- Returns:
this
-
vpc
Sets the value ofDatabaseInstanceNewProps.getVpc()
- Parameters:
vpc
- The VPC network where the DB subnet group should be created. This parameter is required.- Returns:
this
-
autoMinorVersionUpgrade
@Stability(Stable) public DatabaseInstanceSourceProps.Builder autoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade) Sets the value ofDatabaseInstanceNewProps.getAutoMinorVersionUpgrade()
- Parameters:
autoMinorVersionUpgrade
- Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.- Returns:
this
-
availabilityZone
@Stability(Stable) public DatabaseInstanceSourceProps.Builder availabilityZone(String availabilityZone) Sets the value ofDatabaseInstanceNewProps.getAvailabilityZone()
- Parameters:
availabilityZone
- The name of the Availability Zone where the DB instance will be located.- Returns:
this
-
backupRetention
@Stability(Stable) public DatabaseInstanceSourceProps.Builder backupRetention(Duration backupRetention) Sets the value ofDatabaseInstanceNewProps.getBackupRetention()
- Parameters:
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.- Returns:
this
-
cloudwatchLogsExports
@Stability(Stable) public DatabaseInstanceSourceProps.Builder cloudwatchLogsExports(List<String> cloudwatchLogsExports) Sets the value ofDatabaseInstanceNewProps.getCloudwatchLogsExports()
- Parameters:
cloudwatchLogsExports
- The list of log types that need to be enabled for exporting to CloudWatch Logs.- Returns:
this
-
cloudwatchLogsRetention
@Stability(Stable) public DatabaseInstanceSourceProps.Builder cloudwatchLogsRetention(RetentionDays cloudwatchLogsRetention) Sets the value ofDatabaseInstanceNewProps.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 DatabaseInstanceSourceProps.Builder cloudwatchLogsRetentionRole(IRole cloudwatchLogsRetentionRole) Sets the value ofDatabaseInstanceNewProps.getCloudwatchLogsRetentionRole()
- Parameters:
cloudwatchLogsRetentionRole
- The IAM role for the Lambda function associated with the custom resource that sets the retention policy.- Returns:
this
-
copyTagsToSnapshot
@Stability(Stable) public DatabaseInstanceSourceProps.Builder copyTagsToSnapshot(Boolean copyTagsToSnapshot) Sets the value ofDatabaseInstanceNewProps.getCopyTagsToSnapshot()
- Parameters:
copyTagsToSnapshot
- Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.- Returns:
this
-
deleteAutomatedBackups
@Stability(Stable) public DatabaseInstanceSourceProps.Builder deleteAutomatedBackups(Boolean deleteAutomatedBackups) Sets the value ofDatabaseInstanceNewProps.getDeleteAutomatedBackups()
- Parameters:
deleteAutomatedBackups
- Indicates whether automated backups should be deleted or retained when you delete a DB instance.- Returns:
this
-
deletionProtection
@Stability(Stable) public DatabaseInstanceSourceProps.Builder deletionProtection(Boolean deletionProtection) Sets the value ofDatabaseInstanceNewProps.getDeletionProtection()
- Parameters:
deletionProtection
- Indicates whether the DB instance should have deletion protection enabled.- Returns:
this
-
domain
Sets the value ofDatabaseInstanceNewProps.getDomain()
- Parameters:
domain
- The Active Directory directory ID to create the DB instance in.- Returns:
this
-
domainRole
Sets the value ofDatabaseInstanceNewProps.getDomainRole()
- Parameters:
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.- Returns:
this
-
enablePerformanceInsights
@Stability(Stable) public DatabaseInstanceSourceProps.Builder enablePerformanceInsights(Boolean enablePerformanceInsights) Sets the value ofDatabaseInstanceNewProps.getEnablePerformanceInsights()
- Parameters:
enablePerformanceInsights
- Whether to enable Performance Insights for the DB instance.- Returns:
this
-
iamAuthentication
@Stability(Stable) public DatabaseInstanceSourceProps.Builder iamAuthentication(Boolean iamAuthentication) Sets the value ofDatabaseInstanceNewProps.getIamAuthentication()
- Parameters:
iamAuthentication
- Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.- Returns:
this
-
instanceIdentifier
@Stability(Stable) public DatabaseInstanceSourceProps.Builder instanceIdentifier(String instanceIdentifier) Sets the value ofDatabaseInstanceNewProps.getInstanceIdentifier()
- Parameters:
instanceIdentifier
- A name for the DB instance. If you specify a name, AWS CloudFormation converts it to lowercase.- Returns:
this
-
iops
Sets the value ofDatabaseInstanceNewProps.getIops()
- Parameters:
iops
- The number of I/O operations per second (IOPS) that the database provisions. The value must be equal to or greater than 1000.- Returns:
this
-
maxAllocatedStorage
@Stability(Stable) public DatabaseInstanceSourceProps.Builder maxAllocatedStorage(Number maxAllocatedStorage) Sets the value ofDatabaseInstanceNewProps.getMaxAllocatedStorage()
- Parameters:
maxAllocatedStorage
- Upper limit to which RDS can scale the storage in GiB(Gibibyte).- Returns:
this
-
monitoringInterval
@Stability(Stable) public DatabaseInstanceSourceProps.Builder monitoringInterval(Duration monitoringInterval) Sets the value ofDatabaseInstanceNewProps.getMonitoringInterval()
- Parameters:
monitoringInterval
- The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.- Returns:
this
-
monitoringRole
Sets the value ofDatabaseInstanceNewProps.getMonitoringRole()
- Parameters:
monitoringRole
- Role that will be used to manage DB instance monitoring.- Returns:
this
-
multiAz
Sets the value ofDatabaseInstanceNewProps.getMultiAz()
- Parameters:
multiAz
- Specifies if the database instance is a multiple Availability Zone deployment.- Returns:
this
-
optionGroup
Sets the value ofDatabaseInstanceNewProps.getOptionGroup()
- Parameters:
optionGroup
- The option group to associate with the instance.- Returns:
this
-
parameterGroup
@Stability(Stable) public DatabaseInstanceSourceProps.Builder parameterGroup(IParameterGroup parameterGroup) Sets the value ofDatabaseInstanceNewProps.getParameterGroup()
- Parameters:
parameterGroup
- The DB parameter group to associate with the instance.- Returns:
this
-
performanceInsightEncryptionKey
@Stability(Stable) public DatabaseInstanceSourceProps.Builder performanceInsightEncryptionKey(IKey performanceInsightEncryptionKey) Sets the value ofDatabaseInstanceNewProps.getPerformanceInsightEncryptionKey()
- Parameters:
performanceInsightEncryptionKey
- The AWS KMS key for encryption of Performance Insights data.- Returns:
this
-
performanceInsightRetention
@Stability(Stable) public DatabaseInstanceSourceProps.Builder performanceInsightRetention(PerformanceInsightRetention performanceInsightRetention) Sets the value ofDatabaseInstanceNewProps.getPerformanceInsightRetention()
- Parameters:
performanceInsightRetention
- The amount of time, in days, to retain Performance Insights data.- Returns:
this
-
port
Sets the value ofDatabaseInstanceNewProps.getPort()
- Parameters:
port
- The port for the instance.- Returns:
this
-
preferredBackupWindow
@Stability(Stable) public DatabaseInstanceSourceProps.Builder preferredBackupWindow(String preferredBackupWindow) Sets the value ofDatabaseInstanceNewProps.getPreferredBackupWindow()
- Parameters:
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.
- Must be in the format
- Returns:
this
-
preferredMaintenanceWindow
@Stability(Stable) public DatabaseInstanceSourceProps.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) Sets the value ofDatabaseInstanceNewProps.getPreferredMaintenanceWindow()
- Parameters:
preferredMaintenanceWindow
- The weekly time range (in UTC) during which system maintenance can occur. Format:ddd:hh24:mi-ddd:hh24:mi
Constraint: Minimum 30-minute window- Returns:
this
-
processorFeatures
@Stability(Stable) public DatabaseInstanceSourceProps.Builder processorFeatures(ProcessorFeatures processorFeatures) Sets the value ofDatabaseInstanceNewProps.getProcessorFeatures()
- Parameters:
processorFeatures
- The number of CPU cores and the number of threads per core.- Returns:
this
-
publiclyAccessible
@Stability(Stable) public DatabaseInstanceSourceProps.Builder publiclyAccessible(Boolean publiclyAccessible) Sets the value ofDatabaseInstanceNewProps.getPubliclyAccessible()
- Parameters:
publiclyAccessible
- Indicates whether the DB instance is an internet-facing instance.- Returns:
this
-
removalPolicy
@Stability(Stable) public DatabaseInstanceSourceProps.Builder removalPolicy(RemovalPolicy removalPolicy) Sets the value ofDatabaseInstanceNewProps.getRemovalPolicy()
- Parameters:
removalPolicy
- The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.- Returns:
this
-
s3ExportBuckets
@Stability(Stable) public DatabaseInstanceSourceProps.Builder s3ExportBuckets(List<? extends IBucket> s3ExportBuckets) Sets the value ofDatabaseInstanceNewProps.getS3ExportBuckets()
- Parameters:
s3ExportBuckets
- S3 buckets that you want to load data into. This property must not be used ifs3ExportRole
is used.For Microsoft SQL Server:
- Returns:
this
-
s3ExportRole
Sets the value ofDatabaseInstanceNewProps.getS3ExportRole()
- Parameters:
s3ExportRole
- Role that will be associated with this DB instance to enable S3 export. This property must not be used ifs3ExportBuckets
is used.For Microsoft SQL Server:
- Returns:
this
-
s3ImportBuckets
@Stability(Stable) public DatabaseInstanceSourceProps.Builder s3ImportBuckets(List<? extends IBucket> s3ImportBuckets) Sets the value ofDatabaseInstanceNewProps.getS3ImportBuckets()
- Parameters:
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:
- Returns:
this
-
s3ImportRole
Sets the value ofDatabaseInstanceNewProps.getS3ImportRole()
- Parameters:
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:
- Returns:
this
-
securityGroups
@Stability(Stable) public DatabaseInstanceSourceProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups) Sets the value ofDatabaseInstanceNewProps.getSecurityGroups()
- Parameters:
securityGroups
- The security groups to assign to the DB instance.- Returns:
this
-
storageType
Sets the value ofDatabaseInstanceNewProps.getStorageType()
- Parameters:
storageType
- The storage type. Storage types supported are gp2, io1, standard.- Returns:
this
-
subnetGroup
Sets the value ofDatabaseInstanceNewProps.getSubnetGroup()
- Parameters:
subnetGroup
- Existing subnet group for the instance.- Returns:
this
-
vpcPlacement
@Stability(Deprecated) @Deprecated public DatabaseInstanceSourceProps.Builder vpcPlacement(SubnetSelection vpcPlacement) Deprecated.use `vpcSubnets`Sets the value ofDatabaseInstanceNewProps.getVpcPlacement()
- Parameters:
vpcPlacement
- The type of subnets to add to the created DB subnet group.- Returns:
this
-
vpcSubnets
@Stability(Stable) public DatabaseInstanceSourceProps.Builder vpcSubnets(SubnetSelection vpcSubnets) Sets the value ofDatabaseInstanceNewProps.getVpcSubnets()
- Parameters:
vpcSubnets
- The type of subnets to add to the created DB subnet group.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DatabaseInstanceSourceProps>
- Returns:
- a new instance of
DatabaseInstanceSourceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-