# InstanceProps

Instance properties for database instances.

- Source: [`aws-rds/lib/props.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-rds/lib/props.ts#L10)
- Type last changed: v2.132.0 · 9 Mar 2024

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

- `allowMajorVersionUpgrade`: boolean = false — Whether to allow upgrade of major version for the DB instance.

- `autoMinorVersionUpgrade`: boolean = true — Whether to enable automatic upgrade of minor version for the DB instance.

- `deleteAutomatedBackups`: boolean = true — Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.

- `enablePerformanceInsights`: boolean — Whether to enable Performance Insights for the DB instance.

  **Default:** false, unless ``performanceInsightRetention`` or ``performanceInsightEncryptionKey`` is set.

- `instanceType`: [InstanceType](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InstanceType.html) — What type of instance to start for the replicas.

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

- `parameterGroup`: [IParameterGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.IParameterGroup.html) — The DB parameter group to associate with the instance.

  **Default:** no parameter group

- `parameters`: { [key: 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.

- `performanceInsightEncryptionKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — The AWS KMS key for encryption of Performance Insights data.

  **Default:** default master key

- `performanceInsightRetention`: [PerformanceInsightRetention](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.PerformanceInsightRetention.html) = 7 — The amount of time, in days, to retain Performance Insights data.

- `preferredMaintenanceWindow`: 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'

- `publiclyAccessible`: boolean — Indicates whether the DB instance is an internet-facing instance.

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

- `securityGroups`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html)[] — Security group.

  **Default:** a new security group is created.

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) (required) — What subnets to run the RDS instances in.

  Must be at least 2 subnets in two different AZs.

- `vpcSubnets`: [SubnetSelection](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetSelection.html) — Where to place the instances within the VPC.

  **Default:** the Vpc default strategy if not specified.
