DatabaseClusterProps Struct
Properties for a new database cluster.
Example
declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(this, 'Database', {
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_01_0 }),
credentials: rds.Credentials.fromGeneratedSecret('clusteradmin'), // Optional - will default to 'admin' username and generated password
writer: rds.ClusterInstance.provisioned('writer', {
publiclyAccessible: false,
}),
readers: [
rds.ClusterInstance.provisioned('reader1', { promotionTier: 1 }),
rds.ClusterInstance.serverlessV2('reader2'),
],
vpcSubnets: {
subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
},
vpc,
});
Properties
autoMinorVersionUpgradebooleanauto_minor_version_upgradeboolautoMinorVersionUpgradeBooleanAutoMinorVersionUpgradeboolAutoMinorVersionUpgrade*bool= true#backtrackWindowDurationbacktrack_windowDurationbacktrackWindowDurationBacktrackWindowDurationBacktrackWindowDuration= 0 seconds (no backtrack)#This feature is only supported by the Aurora MySQL database engine and cannot be enabled on existing clusters.
backupBackupPropsbackupBackupPropsbackupBackupPropsBackupBackupPropsBackupBackupProps= Backup retention period for auto…#default
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.
cloudwatchLogsExportsstring[]cloudwatch_logs_exportstyping.List[str]cloudwatchLogsExportsList<String>CloudwatchLogsExportsstring[]CloudwatchLogsExports*[]*string= no log exports#cloudwatchLogsRetentionRetentionDayscloudwatch_logs_retentionRetentionDayscloudwatchLogsRetentionRetentionDaysCloudwatchLogsRetentionRetentionDaysCloudwatchLogsRetentionRetentionDays= logs never expire#When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to Infinity.
cloudwatchLogsRetentionRoleIRolecloudwatch_logs_retention_roleIRolecloudwatchLogsRetentionRoleIRoleCloudwatchLogsRetentionRoleIRoleCloudwatchLogsRetentionRoleIRole= a new role is created.#clusterIdentifierstringcluster_identifierstrclusterIdentifierStringClusterIdentifierstringClusterIdentifier*string= A name is automatically generate…#default
Default: A name is automatically generated.
clusterScailabilityTypeClusterScailabilityTypecluster_scailability_typeClusterScailabilityTypeclusterScailabilityTypeClusterScailabilityTypeClusterScailabilityTypeClusterScailabilityTypeClusterScailabilityTypeClusterScailabilityType= ClusterScailabilityType.STANDARDdeprecated#Set LIMITLESS if you want to use a limitless database; otherwise, set it to STANDARD.
clusterScalabilityTypeClusterScalabilityTypecluster_scalability_typeClusterScalabilityTypeclusterScalabilityTypeClusterScalabilityTypeClusterScalabilityTypeClusterScalabilityTypeClusterScalabilityTypeClusterScalabilityType= ClusterScalabilityType.STANDARD#Set LIMITLESS if you want to use a limitless database; otherwise, set it to STANDARD.
copyTagsToSnapshotbooleancopy_tags_to_snapshotboolcopyTagsToSnapshotBooleanCopyTagsToSnapshotboolCopyTagsToSnapshot*bool= true#credentialsCredentialscredentialsCredentialscredentialsCredentialsCredentialsCredentialsCredentialsCredentials= A username of 'admin' (or 'postg…#default
Default: A username of 'admin' (or 'postgres' for PostgreSQL) and SecretsManager-generated password
databaseInsightsModeDatabaseInsightsModedatabase_insights_modeDatabaseInsightsModedatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsMode= DatabaseInsightsMode.STANDARD wh…#default
Default: DatabaseInsightsMode.STANDARD when performance insights are enabled and Amazon Aurora engine is used, otherwise not set.
defaultDatabaseNamestringdefault_database_namestrdefaultDatabaseNameStringDefaultDatabaseNamestringDefaultDatabaseName*string= Database is not created in clust…#default
Default: Database is not created in cluster.
deleteAutomatedBackupsbooleandelete_automated_backupsbooldeleteAutomatedBackupsBooleanDeleteAutomatedBackupsboolDeleteAutomatedBackups*bool= undefined - AWS RDS default is t…#default
Default: undefined - AWS RDS default is to remove automated backups immediately after the DB cluster is deleted, unless the AWS Backup policy specifies a point-in-time restore rule.
deletionProtectionbooleandeletion_protectionbooldeletionProtectionBooleanDeletionProtectionboolDeletionProtection*bool= true if `removalPolicy` is RETAI…#default
Default: true if removalPolicy is RETAIN, undefined otherwise, which will not enable deletion protection. To disable deletion protection after it has been enabled, you must explicitly set this value to false.
notes · default
Necessary for enabling Kerberos authentication. If specified, the DB cluster joins the given Active Directory, enabling Kerberos authentication. If not specified, the DB cluster will not be associated with any Active Directory, and Kerberos authentication will not be enabled.
Default: DB cluster is not associated with an Active Directory; Kerberos authentication is not enabled.
domainRoleIRoledomain_roleIRoledomainRoleIRoleDomainRoleIRoleDomainRoleIRole= If `DatabaseClusterBaseProps.dom…#The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.
default
Default: If DatabaseClusterBaseProps.domain is specified, a role with the AmazonRDSDirectoryServiceAccess policy is automatically created.
enableClusterLevelEnhancedMonitoringbooleanenable_cluster_level_enhanced_monitoringboolenableClusterLevelEnhancedMonitoringBooleanEnableClusterLevelEnhancedMonitoringboolEnableClusterLevelEnhancedMonitoring*bool= When the `monitoringInterval` is…#If set to true, monitoringInterval and monitoringRole are applied to not the instances, but the cluster. monitoringInterval is required to be set if enableClusterLevelEnhancedMonitoring is set to true.
default
Default: When the monitoringInterval is set, enhanced monitoring is enabled for each instance.
enableDataApibooleanenable_data_apiboolenableDataApiBooleanEnableDataApiboolEnableDataApi*bool= false#enableLocalWriteForwardingbooleanenable_local_write_forwardingboolenableLocalWriteForwardingBooleanEnableLocalWriteForwardingboolEnableLocalWriteForwarding*bool= false#This setting can only be enabled for Aurora MySQL 3.04 or higher, and for Aurora PostgreSQL 16.4 or higher (for version 16), 15.8 or higher (for version 15), and 14.13 or higher (for version 14).
enablePerformanceInsightsbooleanenable_performance_insightsboolenablePerformanceInsightsBooleanEnablePerformanceInsightsboolEnablePerformanceInsights*bool= false, unless `performanceInsigh…#default
Default: false, unless performanceInsightRetention or performanceInsightEncryptionKey is set, or databaseInsightsMode is set to DatabaseInsightsMode.ADVANCED.
engineIClusterEngineengineIClusterEngineengineIClusterEngineEngineIClusterEngineEngineIClusterEnginerequired#engineLifecycleSupportEngineLifecycleSupportengine_lifecycle_supportEngineLifecycleSupportengineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupport= undefined - AWS RDS default sett…#default
Default: undefined - AWS RDS default setting is EngineLifecycleSupport.OPEN_SOURCE_RDS_EXTENDED_SUPPORT
iamAuthenticationbooleaniam_authenticationbooliamAuthenticationBooleanIamAuthenticationboolIamAuthentication*bool= false#instanceIdentifierBasestringinstance_identifier_basestrinstanceIdentifierBaseStringInstanceIdentifierBasestringInstanceIdentifierBase*string= clusterIdentifier is used with t…#Every replica is named by appending the replica number to this string, 1-based.
default
Default: clusterIdentifier is used with the word "Instance" appended. If clusterIdentifier is not provided, the identifier is automatically generated.
instancePropsInstancePropsinstance_propsInstancePropsinstancePropsInstancePropsInstancePropsInstancePropsInstancePropsInstancePropsdeprecated#Has to be at least 1.
instanceUpdateBehaviourInstanceUpdateBehaviourinstance_update_behaviourInstanceUpdateBehaviourinstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviour= InstanceUpdateBehaviour.BULK#manageMasterUserPasswordbooleanmanage_master_user_passwordboolmanageMasterUserPasswordBooleanManageMasterUserPasswordboolManageMasterUserPassword*bool= false#When enabled, RDS generates and manages the master user password in Secrets Manager. Cannot be used together with credentials containing a password.
monitoringIntervalDurationmonitoring_intervalDurationmonitoringIntervalDurationMonitoringIntervalDurationMonitoringIntervalDuration= no enhanced monitoring#If you enable enableClusterLevelEnhancedMonitoring, this property is applied to the cluster, otherwise it is applied to the instances.
monitoringRoleIRolemonitoring_roleIRolemonitoringRoleIRoleMonitoringRoleIRoleMonitoringRoleIRole= A role is automatically created …#If you enable enableClusterLevelEnhancedMonitoring, this property is applied to the cluster, otherwise it is applied to the instances.
default
Default: A role is automatically created for you
networkTypeNetworkTypenetwork_typeNetworkTypenetworkTypeNetworkTypeNetworkTypeNetworkTypeNetworkTypeNetworkType= IPV4#parameterGroupIParameterGroupparameter_groupIParameterGroupparameterGroupIParameterGroupParameterGroupIParameterGroupParameterGroupIParameterGroup= No parameter group.#parameters{ [key: string]: string }parameterstyping.Mapping[str, str]parametersMap<String, String>ParametersIDictionary<string, string>Parameters*map[string]*string= None#You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBClusterParameterGroup.
performanceInsightEncryptionKeyIKeyperformance_insight_encryption_keyIKeyperformanceInsightEncryptionKeyIKeyPerformanceInsightEncryptionKeyIKeyPerformanceInsightEncryptionKeyIKey= default master key#performanceInsightRetentionPerformanceInsightRetentionperformance_insight_retentionPerformanceInsightRetentionperformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetention= 7#If you set databaseInsightsMode to DatabaseInsightsMode.ADVANCED, you must set this property to PerformanceInsightRetention.MONTHS_15.
default
Default: The default for the engine is used.
preferredMaintenanceWindowstringpreferred_maintenance_windowstrpreferredMaintenanceWindowStringPreferredMaintenanceWindowstringPreferredMaintenanceWindow*string= 30-minute window selected at ran…#Example: 'Sun:23:45-Mon:00:15'
default
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.
readersIClusterInstance[]readerstyping.List[IClusterInstance]readersList<IClusterInstance>ReadersIClusterInstance[]Readers*[]IClusterInstance= no readers are created. The clus…#default
Default: no readers are created. The cluster will have a single writer/reader
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.SNAPSHOT (remove t…#default
Default: RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)
replicationSourceIdentifierstringreplication_source_identifierstrreplicationSourceIdentifierStringReplicationSourceIdentifierstringReplicationSourceIdentifier*string= This DB Cluster is not a read re…#Cannot be used with credentials.
default
Default: This DB Cluster is not a read replica
s3ExportBucketsIBucket[]s3_export_bucketstyping.List[IBucket]s3ExportBucketsList<IBucket>S3ExportBucketsIBucket[]S3ExportBuckets*[]IBucket= None#This property must not be used if s3ExportRole is used.
For MySQL:
s3ExportRoleIRoles3_export_roleIRoles3ExportRoleIRoleS3ExportRoleIRoleS3ExportRoleIRole= New role is created if `s3Export…#notes · default
This feature is only supported by the Aurora database engine.
This property must not be used if s3ExportBuckets is used. To use this property with Aurora PostgreSQL, it must be configured with the S3 export feature enabled when creating the DatabaseClusterEngine For MySQL:
Default: New role is created if s3ExportBuckets is set, no role is defined otherwise
s3ImportBucketsIBucket[]s3_import_bucketstyping.List[IBucket]s3ImportBucketsList<IBucket>S3ImportBucketsIBucket[]S3ImportBuckets*[]IBucket= None#This property must not be used if s3ImportRole is used.
For MySQL:
s3ImportRoleIRoles3_import_roleIRoles3ImportRoleIRoleS3ImportRoleIRoleS3ImportRoleIRole= New role is created if `s3Import…#notes · default
This feature is only supported by the Aurora database engine.
This property must not be used if s3ImportBuckets is used. To use this property with Aurora PostgreSQL, it must be configured with the S3 import feature enabled when creating the DatabaseClusterEngine For MySQL:
Default: New role is created if s3ImportBuckets is set, no role is defined otherwise
securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= a new security group is created.#serverlessV2AutoPauseDurationDurationserverless_v2_auto_pause_durationDurationserverlessV2AutoPauseDurationDurationServerlessV2AutoPauseDurationDurationServerlessV2AutoPauseDurationDuration= The default is 300 seconds (5 mi…#The duration must be between 300 seconds (5 minutes) and 86,400 seconds (24 hours).
default
Default: The default is 300 seconds (5 minutes).
serverlessV2MaxCapacitynumberserverless_v2_max_capacityint | floatserverlessV2MaxCapacityNumberServerlessV2MaxCapacitydoubleServerlessV2MaxCapacity*float64= 2#You can specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The largest value that you can use is 256.
The maximum capacity must be higher than 0.5 ACUs.
serverlessV2MinCapacitynumberserverless_v2_min_capacityint | floatserverlessV2MinCapacityNumberServerlessV2MinCapacitydoubleServerlessV2MinCapacity*float64= 0.5#notes
You can specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. The smallest value that you can use is 0.
For Aurora versions that support the Aurora Serverless v2 auto-pause feature, the smallest value that you can use is 0. For versions that don't support Aurora Serverless v2 auto-pause, the smallest value that you can use is 0.5.
storageEncryptedbooleanstorage_encryptedboolstorageEncryptedBooleanStorageEncryptedboolStorageEncrypted*bool= true if storageEncryptionKey is …#default
Default: true if storageEncryptionKey is provided, false otherwise
storageEncryptionKeyIKeyRefstorage_encryption_keyIKeyRefstorageEncryptionKeyIKeyRefStorageEncryptionKeyIKeyRefStorageEncryptionKeyIKeyRef= if storageEncrypted is true then…#If specified, storageEncrypted will be set to true.
default
Default: if storageEncrypted is true then the default master key, no key otherwise
storageTypeDBClusterStorageTypestorage_typeDBClusterStorageTypestorageTypeDBClusterStorageTypeStorageTypeDBClusterStorageTypeStorageTypeDBClusterStorageType= DBClusterStorageType.AURORA#subnetGroupIDBSubnetGroupRefsubnet_groupIDBSubnetGroupRefsubnetGroupIDBSubnetGroupRefSubnetGroupIDBSubnetGroupRefSubnetGroupIDBSubnetGroupRef= a new subnet group will be creat…#default
Default: a new subnet group will be created.
Must be at least 2 subnets in two different AZs.
vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection= the Vpc default strategy if not …#default
Default: the Vpc default strategy if not specified.
writerIClusterInstancewriterIClusterInstancewriterIClusterInstanceWriterIClusterInstanceWriterIClusterInstance= required if instanceProps is not…#default
Default: required if instanceProps is not provided