AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

DatabaseInstance

A database instance.

Import

import { DatabaseInstance } from 'aws-cdk-lib/aws-docdb';

Or use the module namespace:

import * as docdb from 'aws-cdk-lib/aws-docdb';
// docdb.DatabaseInstance

Properties

Configuration passed to the constructor as DatabaseInstanceProps.

clusterRequired
IDBClusterRef

The DocumentDB database cluster the instance should launch into.

instanceTypeRequired
InstanceType

The name of the compute and memory capacity classes.

autoMinorVersionUpgradeOptional
boolean

Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.

Default: true

availabilityZoneOptional
string

The name of the Availability Zone where the DB instance will be located.

Default: - no preference

caCertificateOptional
CaCertificate

The identifier of the CA certificate for this DB instance. Specifying or updating this property triggers a reboot.

Default: - DocumentDB will choose a certificate authority

dbInstanceNameOptional
string

A name for the DB instance. If you specify a name, AWS CloudFormation converts it to lowercase.

Default: - a CloudFormation generated name

enablePerformanceInsightsOptional
boolean

A value that indicates whether to enable Performance Insights for the DB Instance.

Default: - false

preferredMaintenanceWindowOptional
string

The weekly time range (in UTC) during which system maintenance can occur. Format: `ddd:hh24:mi-ddd:hh24:mi` Constraint: Minimum 30-minute window

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

removalPolicyOptional
RemovalPolicy

The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.

Default: RemovalPolicy.Retain

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter