Skip to content
v2.273.0

InstanceProps Struct ​

Instance properties for database instances.

Example ​

ts
declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({
    version: rds.AuroraMysqlEngineVersion.VER_3_03_0,
  }),
  instances: 2,
  instanceProps: {
    instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
    vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
    vpc,
  },
});

Properties ​

allowMajorVersionUpgradebooleanallow_major_version_upgradeboolallowMajorVersionUpgradeBooleanAllowMajorVersionUpgradeboolAllowMajorVersionUpgrade*bool= false#
Whether to allow upgrade of major version for the DB instance.
autoMinorVersionUpgradebooleanauto_minor_version_upgradeboolautoMinorVersionUpgradeBooleanAutoMinorVersionUpgradeboolAutoMinorVersionUpgrade*bool= true#
Whether to enable automatic upgrade of minor version for the DB instance.
deleteAutomatedBackupsbooleandelete_automated_backupsbooldeleteAutomatedBackupsBooleanDeleteAutomatedBackupsboolDeleteAutomatedBackups*bool= true#
Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.
enablePerformanceInsightsbooleanenable_performance_insightsboolenablePerformanceInsightsBooleanEnablePerformanceInsightsboolEnablePerformanceInsights*bool= false, unless ``performanceInsig…#
Whether to enable Performance Insights for the DB instance.
default

Default: false, unless performanceInsightRetention or performanceInsightEncryptionKey is set.

instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceType= t3.medium (or, more precisely, d…#
What type of instance to start for the replicas.
default

Default: t3.medium (or, more precisely, db.t3.medium)

parameterGroupIParameterGroupparameter_groupIParameterGroupparameterGroupIParameterGroupParameterGroupIParameterGroupParameterGroupIParameterGroup= no parameter group#
The DB parameter group to associate with the instance.
parameters{ [key: string]: string }parameterstyping.Mapping[str, str]parametersMap<String, String>ParametersIDictionary<string, string>Parameters*map[string]*string= None#
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.

performanceInsightEncryptionKeyIKeyperformance_insight_encryption_keyIKeyperformanceInsightEncryptionKeyIKeyPerformanceInsightEncryptionKeyIKeyPerformanceInsightEncryptionKeyIKey= default master key#
The AWS KMS key for encryption of Performance Insights data.
performanceInsightRetentionPerformanceInsightRetentionperformance_insight_retentionPerformanceInsightRetentionperformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetention= 7#
The amount of time, in days, to retain Performance Insights data.
preferredMaintenanceWindowstringpreferred_maintenance_windowstrpreferredMaintenanceWindowStringPreferredMaintenanceWindowstringPreferredMaintenanceWindow*string= 30-minute window selected at ran…#
A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).

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.

publiclyAccessiblebooleanpublicly_accessibleboolpubliclyAccessibleBooleanPubliclyAccessibleboolPubliclyAccessible*bool= `true` if `vpcSubnets` is `subne…#
Indicates whether the DB instance is an internet-facing instance.
default

Default: true if vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= a new security group is created.#
Security group.
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
What subnets to run the RDS instances in.

Must be at least 2 subnets in two different AZs.

vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection= the Vpc default strategy if not …#
Where to place the instances within the VPC.
default

Default: the Vpc default strategy if not specified.