aws-cdk-lib.aws_rds.ProvisionedClusterInstanceProps

interface ProvisionedClusterInstanceProps

LanguageType name
.NETAmazon.CDK.AWS.RDS.ProvisionedClusterInstanceProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsrds#ProvisionedClusterInstanceProps
Javasoftware.amazon.awscdk.services.rds.ProvisionedClusterInstanceProps
Pythonaws_cdk.aws_rds.ProvisionedClusterInstanceProps
TypeScript (source)aws-cdk-lib » aws_rds » ProvisionedClusterInstanceProps

Options for creating a provisioned instance.

Example

declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_08_1 }),
  credentials: rds.Credentials.fromGeneratedSecret('clusteradmin'), // Optional - will default to 'admin' username and generated password
  writer: rds.ClusterInstance.provisioned('writer', {
  readers: [
    rds.ClusterInstance.provisioned('reader1', { promotionTier: 1 }),
    rds.ClusterInstance.serverlessV2('reader2'),
  ]
  vpcSubnets: {
    subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
  },
  vpc,
});

Properties

NameTypeDescription
allowMajorVersionUpgrade?booleanWhether to allow upgrade of major version for the DB instance.
autoMinorVersionUpgrade?booleanWhether to enable automatic upgrade of minor version for the DB instance.
enablePerformanceInsights?booleanWhether to enable Performance Insights for the DB instance.
instanceIdentifier?stringThe identifier for the database instance.
instanceType?InstanceTypeThe cluster instance type.
isFromLegacyInstanceProps?booleanOnly used for migrating existing clusters from using instanceProps to writer and readers.
parameterGroup?IParameterGroupThe DB parameter group to associate with the instance.
parameters?{ [string]: string }The parameters in the DBParameterGroup to create automatically.
performanceInsightEncryptionKey?IKeyThe AWS KMS key for encryption of Performance Insights data.
performanceInsightRetention?PerformanceInsightRetentionThe amount of time, in days, to retain Performance Insights data.
promotionTier?numberThe promotion tier of the cluster instance.
publiclyAccessible?booleanIndicates whether the DB instance is an internet-facing instance.

allowMajorVersionUpgrade?

Type: boolean (optional, default: false)

Whether to allow upgrade of major version for the DB instance.


autoMinorVersionUpgrade?

Type: boolean (optional, default: true)

Whether to enable automatic upgrade of minor version for the DB instance.


enablePerformanceInsights?

Type: boolean (optional, default: false, unless performanceInsightRentention or performanceInsightEncryptionKey is set.)

Whether to enable Performance Insights for the DB instance.


instanceIdentifier?

Type: string (optional, default: CloudFormation generated identifier)

The identifier for the database instance.


instanceType?

Type: InstanceType (optional, default: db.t3.medium)

The cluster instance type.


isFromLegacyInstanceProps?

Type: boolean (optional, default: false)

Only used for migrating existing clusters from using instanceProps to writer and readers. Example

// existing cluster
declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(stack, '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,
};

declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(stack, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({
    version: rds.AuroraMysqlEngineVersion.VER_3_03_0,
  }),
  vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
  vpc,
  writer: ClusterInstance.provisioned('Instance1', {
    ...instanceProps,
  }),
  readers: [
    ClusterInstance.provisioned('Instance2', {
      ...instanceProps,
    }),
  ],
});

parameterGroup?

Type: IParameterGroup (optional, default: the cluster parameter group is used)

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


parameters?

Type: { [string]: string } (optional, default: 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.


performanceInsightEncryptionKey?

Type: IKey (optional, default: default master key)

The AWS KMS key for encryption of Performance Insights data.


performanceInsightRetention?

Type: PerformanceInsightRetention (optional, default: 7)

The amount of time, in days, to retain Performance Insights data.


promotionTier?

Type: number (optional, default: 2)

The promotion tier of the cluster instance.

Can be between 0-15

For provisioned instances this just determines the failover priority. If multiple instances have the same priority then one will be picked at random


publiclyAccessible?

Type: boolean (optional, default: true if the instance is placed in a public subnet)

Indicates whether the DB instance is an internet-facing instance.