Skip to content
v2.273.0

ServerlessV2ClusterInstanceProps Struct ​

Options for creating a serverless v2 instance.

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 }),
  writer: rds.ClusterInstance.provisioned('writer', {
    caCertificate: rds.CaCertificate.RDS_CA_RSA2048_G1,
  }),
  readers: [
    rds.ClusterInstance.serverlessV2('reader', {
      caCertificate: rds.CaCertificate.of('custom-ca'),
    }),
  ],
  vpc,
});

Properties ​

allowMajorVersionUpgradebooleanallow_major_version_upgradeboolallowMajorVersionUpgradeBooleanAllowMajorVersionUpgradeboolAllowMajorVersionUpgrade*bool= false#
Whether to allow upgrade of major version for the DB instance.
applyImmediatelybooleanapply_immediatelyboolapplyImmediatelyBooleanApplyImmediatelyboolApplyImmediately*bool= Changes will be applied immediat…#
Specifies whether changes to the DB instance and any pending modifications are applied immediately, regardless of the `preferredMaintenanceWindow` setting.
notes · default

If set to false, changes are applied during the next maintenance window.

Until RDS applies the changes, the DB instance remains in a drift state. As a result, the configuration doesn't fully reflect the requested modifications and temporarily diverges from the intended state.

This property also determines whether the DB instance reboots when a static parameter is modified in the associated DB parameter group.

Default: Changes will be applied immediately

autoMinorVersionUpgradebooleanauto_minor_version_upgradeboolautoMinorVersionUpgradeBooleanAutoMinorVersionUpgradeboolAutoMinorVersionUpgrade*bool= true#
Whether to enable automatic upgrade of minor version for the DB instance.
availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*string= A random, system-chosen Availabi…#
The Availability Zone (AZ) where the database will be created.

For Amazon Aurora, each Aurora DB cluster hosts copies of its storage in three separate Availability Zones. Specify one of these Availability Zones. Aurora automatically chooses an appropriate Availability Zone if you don't specify one.

default

Default: A random, system-chosen Availability Zone in the endpointʼs AWS Region.

caCertificateCaCertificateca_certificateCaCertificatecaCertificateCaCertificateCaCertificateCaCertificateCaCertificateCaCertificate= RDS will choose a certificate au…#
The identifier of the CA certificate for this DB cluster's instances.

Specifying or updating this property triggers a reboot.

For RDS DB engines:

default

Default: RDS will choose a certificate authority

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.

instanceIdentifierstringinstance_identifierstrinstanceIdentifierStringInstanceIdentifierstringInstanceIdentifier*string= CloudFormation generated identif…#
The identifier for the database instance.
default

Default: CloudFormation generated identifier

isFromLegacyInstancePropsbooleanis_from_legacy_instance_propsboolisFromLegacyInstancePropsBooleanIsFromLegacyInstancePropsboolIsFromLegacyInstanceProps*bool= false#
Only used for migrating existing clusters from using `instanceProps` to `writer` and `readers`.
example
ts
// existing cluster
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,
  },
});

// migration

const instanceProps = {
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
  isFromLegacyInstanceProps: true,
};

const myCluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({
    version: rds.AuroraMysqlEngineVersion.VER_3_03_0,
  }),
  vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
  vpc,
  writer: rds.ClusterInstance.provisioned('Instance1', {
    instanceType: instanceProps.instanceType,
    isFromLegacyInstanceProps: instanceProps.isFromLegacyInstanceProps,
  }),
  readers: [
    rds.ClusterInstance.provisioned('Instance2', {
      instanceType: instanceProps.instanceType,
      isFromLegacyInstanceProps: instanceProps.isFromLegacyInstanceProps,
    }),
  ],
});
parameterGroupIParameterGroupparameter_groupIParameterGroupparameterGroupIParameterGroupParameterGroupIParameterGroupParameterGroupIParameterGroup= the cluster parameter group is u…#
The DB parameter group to associate with the instance.

This is only needed if you need to configure different parameter groups for each individual instance, otherwise you should not provide this and just use the cluster parameter group

default

Default: the cluster parameter group is used

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 the cluster's `vpcSubn…#
Indicates whether the DB instance is an internet-facing instance.

If not specified, the cluster's vpcSubnets will be used to determine if the instance is internet-facing or not.

default

Default: true if the cluster's vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise

scaleWithWriterbooleanscale_with_writerboolscaleWithWriterBooleanScaleWithWriterboolScaleWithWriter*bool= false#
Only applicable to reader instances.
notes

If this is true then the instance will be placed in promotion tier 1, otherwise it will be placed in promotion tier 2.

For serverless v2 instances this means:

  • true: The serverless v2 reader will scale to match the writer instance (provisioned or serverless)
  • false: The serverless v2 reader will scale with the read workload on the instance