Skip to content
v2.274.0

DatabaseClusterProps Struct ​

Properties for a new database cluster.

Example ​

ts
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#
Specifies whether minor engine upgrades are applied automatically to the DB cluster during the maintenance window.
backtrackWindowDurationbacktrack_windowDurationbacktrackWindowDurationBacktrackWindowDurationBacktrackWindowDuration#
The number of seconds to set a cluster's target backtrack window to.

Default: 0 seconds (no backtrack)

This feature is only supported by the Aurora MySQL database engine and cannot be enabled on existing clusters.

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.

cloudwatchLogsExportsstring[]cloudwatch_logs_exportstyping.List[str]cloudwatchLogsExportsList<String>CloudwatchLogsExportsstring[]CloudwatchLogsExports*[]*string#
The list of log types that need to be enabled for exporting to CloudWatch Logs.

Default: no log exports

cloudwatchLogsRetentionRetentionDayscloudwatch_logs_retentionRetentionDayscloudwatchLogsRetentionRetentionDaysCloudwatchLogsRetentionRetentionDaysCloudwatchLogsRetentionRetentionDays#
The number of days log events are kept in CloudWatch Logs.

Default: 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#
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

Default: a new role is created.

clusterIdentifierstringcluster_identifierstrclusterIdentifierStringClusterIdentifierstringClusterIdentifier*string#
An optional identifier for the cluster.

Default: A name is automatically generated.

clusterScailabilityTypeClusterScailabilityTypecluster_scailability_typeClusterScailabilityTypeclusterScailabilityTypeClusterScailabilityTypeClusterScailabilityTypeClusterScailabilityTypeClusterScailabilityTypeClusterScailabilityType= ClusterScailabilityType.STANDARDdeprecated#
Use clusterScalabilityType instead. This will be removed in the next major version.

Set LIMITLESS if you want to use a limitless database; otherwise, set it to STANDARD.

clusterScalabilityTypeClusterScalabilityTypecluster_scalability_typeClusterScalabilityTypeclusterScalabilityTypeClusterScalabilityTypeClusterScalabilityTypeClusterScalabilityTypeClusterScalabilityTypeClusterScalabilityType= ClusterScalabilityType.STANDARD#
Specifies the scalability mode of the Aurora DB cluster.

Set LIMITLESS if you want to use a limitless database; otherwise, set it to STANDARD.

copyTagsToSnapshotbooleancopy_tags_to_snapshotboolcopyTagsToSnapshotBooleanCopyTagsToSnapshotboolCopyTagsToSnapshot*bool= true#
Whether to copy tags to the snapshot when a snapshot is created.
credentialsCredentialscredentialsCredentialscredentialsCredentialsCredentialsCredentialsCredentialsCredentials#
Credentials for the administrative user.

Default: A username of 'admin' (or 'postgres' for PostgreSQL) and SecretsManager-generated password

databaseInsightsModeDatabaseInsightsModedatabase_insights_modeDatabaseInsightsModedatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsMode#
The database insights mode.

Default: DatabaseInsightsMode.STANDARD when performance insights are enabled and Amazon Aurora engine is used, otherwise not set.

defaultDatabaseNamestringdefault_database_namestrdefaultDatabaseNameStringDefaultDatabaseNamestringDefaultDatabaseName*string#
Name of a database which is automatically created inside the cluster.

Default: Database is not created in cluster.

deleteAutomatedBackupsbooleandelete_automated_backupsbooldeleteAutomatedBackupsBooleanDeleteAutomatedBackupsboolDeleteAutomatedBackups*bool#
Specifies whether to remove automated backups immediately after the DB cluster is deleted.

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#
Indicates whether the DB cluster should have deletion protection enabled.

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.

domainstringdomainstrdomainStringDomainstringDomain*string#
Directory ID for associating the DB cluster with a specific Active Directory.

Default: DB cluster is not associated with an Active Directory; Kerberos authentication is not enabled.

notes

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.

domainRoleIRoledomain_roleIRoledomainRoleIRoleDomainRoleIRoleDomainRoleIRole#
The IAM role to be used when making API calls to the Directory Service.

Default: If DatabaseClusterBaseProps.domain is specified, a role with the AmazonRDSDirectoryServiceAccess policy is automatically created.

The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.

enableClusterLevelEnhancedMonitoringbooleanenable_cluster_level_enhanced_monitoringboolenableClusterLevelEnhancedMonitoringBooleanEnableClusterLevelEnhancedMonitoringboolEnableClusterLevelEnhancedMonitoring*bool#
Whether to enable enhanced monitoring at the cluster level.

Default: When the monitoringInterval is set, enhanced monitoring is enabled for each instance.

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.

enableDataApibooleanenable_data_apiboolenableDataApiBooleanEnableDataApiboolEnableDataApi*bool= false#
Whether to enable the Data API for the cluster.
enableLocalWriteForwardingbooleanenable_local_write_forwardingboolenableLocalWriteForwardingBooleanEnableLocalWriteForwardingboolEnableLocalWriteForwarding*bool= false#
Whether read replicas can forward write operations to the writer DB instance in the DB cluster.

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#
Whether to enable Performance Insights for the DB cluster.

Default: false, unless performanceInsightRetention or performanceInsightEncryptionKey is set, or databaseInsightsMode is set to DatabaseInsightsMode.ADVANCED.

What kind of database to start.
engineLifecycleSupportEngineLifecycleSupportengine_lifecycle_supportEngineLifecycleSupportengineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupport#
The life cycle type for this DB cluster.

Default: undefined - AWS RDS default setting is EngineLifecycleSupport.OPEN_SOURCE_RDS_EXTENDED_SUPPORT

iamAuthenticationbooleaniam_authenticationbooliamAuthenticationBooleanIamAuthenticationboolIamAuthentication*bool= false#
Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
instanceIdentifierBasestringinstance_identifier_basestrinstanceIdentifierBaseStringInstanceIdentifierBasestringInstanceIdentifierBase*string#
Base identifier for instances.

Default: clusterIdentifier is used with the word "Instance" appended. If clusterIdentifier is not provided, the identifier is automatically generated.

Every replica is named by appending the replica number to this string, 1-based.

instancePropsInstancePropsinstance_propsInstancePropsinstancePropsInstancePropsInstancePropsInstancePropsInstancePropsInstancePropsdeprecated#
- use writer and readers instead
instancesnumberinstancesint | floatinstancesNumberInstancesdoubleInstances*float64= 2deprecated#
- use writer and readers instead

Has to be at least 1.

instanceUpdateBehaviourInstanceUpdateBehaviourinstance_update_behaviourInstanceUpdateBehaviourinstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviourInstanceUpdateBehaviour= InstanceUpdateBehaviour.BULK#
The ordering of updates for instances.
manageMasterUserPasswordbooleanmanage_master_user_passwordboolmanageMasterUserPasswordBooleanManageMasterUserPasswordboolManageMasterUserPassword*bool= false#
Whether to use RDS native integration with AWS Secrets Manager for master user password management.

When enabled, RDS generates and manages the master user password in Secrets Manager. Cannot be used together with credentials containing a password.

monitoringIntervalDurationmonitoring_intervalDurationmonitoringIntervalDurationMonitoringIntervalDurationMonitoringIntervalDuration#
The interval between points when Amazon RDS collects enhanced monitoring metrics.

Default: no enhanced monitoring

If you enable enableClusterLevelEnhancedMonitoring, this property is applied to the cluster, otherwise it is applied to the instances.

monitoringRoleIRolemonitoring_roleIRolemonitoringRoleIRoleMonitoringRoleIRoleMonitoringRoleIRole#
Role that will be used to manage DB monitoring.

Default: A role is automatically created for you

If you enable enableClusterLevelEnhancedMonitoring, this property is applied to the cluster, otherwise it is applied to the instances.

networkTypeNetworkTypenetwork_typeNetworkTypenetworkTypeNetworkTypeNetworkTypeNetworkTypeNetworkTypeNetworkType= IPV4#
The network type of the DB instance.
parameterGroupIParameterGroupparameter_groupIParameterGroupparameterGroupIParameterGroupParameterGroupIParameterGroupParameterGroupIParameterGroup#
Additional parameters to pass to the database engine.

Default: No parameter group.

parameters{ [key: string]: string }parameterstyping.Mapping[str, str]parametersMap<String, String>ParametersIDictionary<string, string>Parameters*map[string]*string= None#
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.

performanceInsightEncryptionKeyIKeyperformance_insight_encryption_keyIKeyperformanceInsightEncryptionKeyIKeyPerformanceInsightEncryptionKeyIKeyPerformanceInsightEncryptionKeyIKey#
The AWS KMS key for encryption of Performance Insights data.

Default: default master key

performanceInsightRetentionPerformanceInsightRetentionperformance_insight_retentionPerformanceInsightRetentionperformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetention= 7#
The amount of time, in days, to retain Performance Insights data.

If you set databaseInsightsMode to DatabaseInsightsMode.ADVANCED, you must set this property to PerformanceInsightRetention.MONTHS_15.

portnumberportint | floatportNumberPortdoublePort*float64#
What port to listen on.

Default: The default for the engine is used.

preferredMaintenanceWindowstringpreferred_maintenance_windowstrpreferredMaintenanceWindowStringPreferredMaintenanceWindowstringPreferredMaintenanceWindow*string#
A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).

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.

Example: 'Sun:23:45-Mon:00:15'

readersIClusterInstance[]readerstyping.List[IClusterInstance]readersList<IClusterInstance>ReadersIClusterInstance[]Readers*[]IClusterInstance#
A list of instances to create as cluster reader instances.

Default: no readers are created. The cluster will have a single writer/reader

removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy#
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)

replicationSourceIdentifierstringreplication_source_identifierstrreplicationSourceIdentifierStringReplicationSourceIdentifierstringReplicationSourceIdentifier*string#
The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a read replica.

Default: This DB Cluster is not a read replica

Cannot be used with credentials.

s3ExportBucketsIBucket[]s3_export_bucketstyping.List[IBucket]s3ExportBucketsList<IBucket>S3ExportBucketsIBucket[]S3ExportBuckets*[]IBucket= None#
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:

s3ExportRoleIRoles3_export_roleIRoles3ExportRoleIRoleS3ExportRoleIRoleS3ExportRoleIRole#
Role that will be associated with this DB cluster to enable S3 export.

Default: New role is created if s3ExportBuckets is set, no role is defined otherwise

notes

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:

s3ImportBucketsIBucket[]s3_import_bucketstyping.List[IBucket]s3ImportBucketsList<IBucket>S3ImportBucketsIBucket[]S3ImportBuckets*[]IBucket= None#
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:

s3ImportRoleIRoles3_import_roleIRoles3ImportRoleIRoleS3ImportRoleIRoleS3ImportRoleIRole#
Role that will be associated with this DB cluster to enable S3 import.

Default: New role is created if s3ImportBuckets is set, no role is defined otherwise

notes

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:

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup#
Security group.

Default: a new security group is created.

serverlessV2AutoPauseDurationDurationserverless_v2_auto_pause_durationDurationserverlessV2AutoPauseDurationDurationServerlessV2AutoPauseDurationDurationServerlessV2AutoPauseDurationDuration#
Specifies the duration an Aurora Serverless v2 DB instance must be idle before Aurora attempts to automatically pause it.

Default: The default is 300 seconds (5 minutes).

The duration must be between 300 seconds (5 minutes) and 86,400 seconds (24 hours).

serverlessV2MaxCapacitynumberserverless_v2_max_capacityint | floatserverlessV2MaxCapacityNumberServerlessV2MaxCapacitydoubleServerlessV2MaxCapacity*float64= 2#
The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.

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#
The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.
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#
Whether to enable storage encryption.

Default: true if storageEncryptionKey is provided, false otherwise

storageEncryptionKeyIKeyRefstorage_encryption_keyIKeyRefstorageEncryptionKeyIKeyRefStorageEncryptionKeyIKeyRefStorageEncryptionKeyIKeyRef#
The KMS key for storage encryption.

Default: if storageEncrypted is true then the default master key, no key otherwise

If specified, storageEncrypted will be set to true.

storageTypeDBClusterStorageTypestorage_typeDBClusterStorageTypestorageTypeDBClusterStorageTypeStorageTypeDBClusterStorageTypeStorageTypeDBClusterStorageType= DBClusterStorageType.AURORA#
The storage type to be associated with the DB cluster.
Existing subnet group for the cluster.

Default: a new subnet group will be created.

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc#
What subnets to run the RDS instances in.

Must be at least 2 subnets in two different AZs.

vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection#
Where to place the instances within the VPC.

Default: the Vpc default strategy if not specified.

The instance to use for the cluster writer.

Default: required if instanceProps is not provided