# DatabaseInstanceProps

Construction properties for a DatabaseInstanceNew.

Used as props by: [DatabaseInstance](/cdk/api/v2/docs/aws-cdk-lib.aws_docdb.DatabaseInstance.html)

- Source: [`aws-docdb/lib/instance.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-docdb/lib/instance.ts#L129)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_docdb as docdb } from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';
import { aws_docdb as interfaces_docdb } from 'aws-cdk-lib/interfaces';

declare const caCertificate: rds.CaCertificate;
declare const dBClusterRef: interfaces_docdb.IDBClusterRef;
declare const instanceType: ec2.InstanceType;
const databaseInstanceProps: docdb.DatabaseInstanceProps = {
  cluster: dBClusterRef,
  instanceType: instanceType,

  // the properties below are optional
  autoMinorVersionUpgrade: false,
  availabilityZone: 'availabilityZone',
  caCertificate: caCertificate,
  dbInstanceName: 'dbInstanceName',
  enablePerformanceInsights: false,
  preferredMaintenanceWindow: 'preferredMaintenanceWindow',
  removalPolicy: cdk.RemovalPolicy.DESTROY,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_docdb as docdb
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_rds as rds
from aws_cdk.interfaces import aws_docdb as interfaces_docdb

# ca_certificate: rds.CaCertificate
# d_b_cluster_ref: interfaces_docdb.IDBClusterRef
# instance_type: ec2.InstanceType

database_instance_props = docdb.DatabaseInstanceProps(
    cluster=d_b_cluster_ref,
    instance_type=instance_type,

    # the properties below are optional
    auto_minor_version_upgrade=False,
    availability_zone="availabilityZone",
    ca_certificate=ca_certificate,
    db_instance_name="dbInstanceName",
    enable_performance_insights=False,
    preferred_maintenance_window="preferredMaintenanceWindow",
    removal_policy=cdk.RemovalPolicy.DESTROY
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.docdb.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.rds.*;
import software.amazon.awscdk.interfaces.docdb.*;

CaCertificate caCertificate;
IDBClusterRef dBClusterRef;
InstanceType instanceType;

DatabaseInstanceProps databaseInstanceProps = DatabaseInstanceProps.builder()
        .cluster(dBClusterRef)
        .instanceType(instanceType)

        // the properties below are optional
        .autoMinorVersionUpgrade(false)
        .availabilityZone("availabilityZone")
        .caCertificate(caCertificate)
        .dbInstanceName("dbInstanceName")
        .enablePerformanceInsights(false)
        .preferredMaintenanceWindow("preferredMaintenanceWindow")
        .removalPolicy(RemovalPolicy.DESTROY)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.DocDB;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.RDS;
using Amazon.CDK.Interfaces.DocDB;

CaCertificate caCertificate;
IDBClusterRef dBClusterRef;
InstanceType instanceType;

var databaseInstanceProps = new DatabaseInstanceProps {
    Cluster = dBClusterRef,
    InstanceType = instanceType,

    // the properties below are optional
    AutoMinorVersionUpgrade = false,
    AvailabilityZone = "availabilityZone",
    CaCertificate = caCertificate,
    DbInstanceName = "dbInstanceName",
    EnablePerformanceInsights = false,
    PreferredMaintenanceWindow = "preferredMaintenanceWindow",
    RemovalPolicy = RemovalPolicy.DESTROY
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var caCertificate CaCertificate
var dBClusterRef IDBClusterRef
var instanceType InstanceType

databaseInstanceProps := &DatabaseInstanceProps{
	Cluster: dBClusterRef,
	InstanceType: instanceType,

	// the properties below are optional
	AutoMinorVersionUpgrade: jsii.Boolean(false),
	AvailabilityZone: jsii.String("availabilityZone"),
	CaCertificate: caCertificate,
	DbInstanceName: jsii.String("dbInstanceName"),
	EnablePerformanceInsights: jsii.Boolean(false),
	PreferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"),
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
}
```

## Properties

- `autoMinorVersionUpgrade`: boolean = true — Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.

- `availabilityZone`: string — The name of the Availability Zone where the DB instance will be located.

  **Default:** no preference

- `caCertificate`: [CaCertificate](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.CaCertificate.html) — The identifier of the CA certificate for this DB instance.

  **Default:** DocumentDB will choose a certificate authority

  Specifying or updating this property triggers a reboot.

- `cluster`: [IDBClusterRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_docdb.IDBClusterRef.html) (required) — The DocumentDB database cluster the instance should launch into.

- `dbInstanceName`: string — A name for the DB instance.

  **Default:** a CloudFormation generated name

  If you specify a name, AWS CloudFormation
  converts it to lowercase.

- `enablePerformanceInsights`: boolean = false — A value that indicates whether to enable Performance Insights for the DB Instance.

- `instanceType`: [InstanceType](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InstanceType.html) (required) — The name of the compute and memory capacity classes.

- `preferredMaintenanceWindow`: string — The weekly time range (in UTC) during which system maintenance can occur.

  **Default:** a 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. To see the time blocks available, see https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html#maintenance-window

  Format: `ddd:hh24:mi-ddd:hh24:mi`
  Constraint: Minimum 30-minute window

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.Retain — The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.
