aws-cdk-lib.aws_rds.InstanceProps

interface InstanceProps

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

Instance properties for database instances.

Example

const cluster = new rds.DatabaseCluster(stack, 'Database', {
  engine: rds.DatabaseClusterEngine.AURORA,
  instanceProps: {
    instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
    vpc,
  },
});

cluster.addRotationSingleUser();

const clusterWithCustomRotationOptions = new rds.DatabaseCluster(stack, 'CustomRotationOptions', {
  engine: rds.DatabaseClusterEngine.AURORA,
  instanceProps: {
    instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
    vpc,
  },
});
clusterWithCustomRotationOptions.addRotationSingleUser({
  automaticallyAfter: cdk.Duration.days(7),
  excludeCharacters: '!@#$%^&*',
  securityGroup,
  vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
  endpoint: endpoint,
});

Properties

NameTypeDescription
vpcIVpcWhat subnets to run the RDS instances in.
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.
deleteAutomatedBackups?booleanWhether to remove automated backups immediately after the DB instance is deleted for the DB instance.
enablePerformanceInsights?booleanWhether to enable Performance Insights for the DB instance.
instanceType?InstanceTypeWhat type of instance to start for the replicas.
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.
publiclyAccessible?booleanIndicates whether the DB instance is an internet-facing instance.
securityGroups?ISecurityGroup[]Security group.
vpcSubnets?SubnetSelectionWhere to place the instances within the VPC.

vpc

Type: IVpc

What subnets to run the RDS instances in.

Must be at least 2 subnets in two different AZs.


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.


deleteAutomatedBackups?

Type: boolean (optional, default: true)

Whether to remove automated backups immediately after the DB instance is deleted 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.


instanceType?

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

What type of instance to start for the replicas.


parameterGroup?

Type: IParameterGroup (optional, default: no parameter group)

The DB parameter group to associate with the instance.


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.


publiclyAccessible?

Type: boolean (optional, default: true if vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise)

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


securityGroups?

Type: ISecurityGroup[] (optional, default: a new security group is created.)

Security group.


vpcSubnets?

Type: SubnetSelection (optional, default: the Vpc default strategy if not specified.)

Where to place the instances within the VPC.