# IDatabaseInstance

A database instance.

Extends: IDatabaseInstance
Extends: IResource, IConnectable, ISecretAttachmentTarget, IDBInstanceRef
Implemented by: DatabaseInstance, DatabaseInstanceBase, DatabaseInstanceFromSnapshot, DatabaseInstanceReadReplica

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

## Properties

- `connections`: [Connections](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) (required) — The network connections associated with this resource.

- `dbInstanceEndpointAddress`: string (required) — The instance endpoint address.

- `dbInstanceEndpointPort`: string (required) — The instance endpoint port.

- `dbInstanceRef`: [DBInstanceReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_rds.DBInstanceReference.html) (required) — A reference to a DBInstance resource.

- `engine`: [IInstanceEngine](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.IInstanceEngine.html) — The engine of this database Instance.

  May be not known for imported Instances if it wasn't provided explicitly,
  or for read replicas.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `instanceArn`: string (required) — The instance arn.

- `instanceEndpoint`: [Endpoint](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.Endpoint.html) (required) — The instance endpoint.

- `instanceIdentifier`: string (required) — The instance identifier.

- `instanceResourceId`: string — The AWS Region-unique, immutable identifier for the DB instance.

  This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB instance is accessed.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this resource is defined.

## Methods

- `addProxy(id: string, options: DatabaseProxyOptions): DatabaseProxy` — Add a new db proxy to this instance.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `asSecretAttachmentTarget(): SecretAttachmentTargetProps` — Renders the target specifications.

- `grantConnect(grantee: IGrantable, dbUser?: string): Grant` — Grant the given identity connection access to the database.

  **Parameters**

  - `grantee` — the Principal to grant the permissions to.
  - `dbUser` — the name of the database user to allow connecting as to the db instance.

- `metric(metricName: string, props?: MetricOptions): Metric` — Return the given named metric for this DBInstance.

- `metricCPUUtilization(props?: MetricOptions): Metric` — The percentage of CPU utilization.

  Average over 5 minutes

- `metricDatabaseConnections(props?: MetricOptions): Metric` — The number of database connections in use.

  Average over 5 minutes

- `metricFreeableMemory(props?: MetricOptions): Metric` — The amount of available random access memory.

  Average over 5 minutes

- `metricFreeStorageSpace(props?: MetricOptions): Metric` — The amount of available storage space.

  Average over 5 minutes

- `metricReadIOPS(props?: MetricOptions): Metric` — The average number of disk write I/O operations per second.

  Average over 5 minutes

- `metricWriteIOPS(props?: MetricOptions): Metric` — The average number of disk read I/O operations per second.

  Average over 5 minutes

- `onEvent(id: string, options?: OnEventOptions): Rule` — Defines a CloudWatch event rule which triggers for instance events.

  Use
  `rule.addEventPattern(pattern)` to specify a filter.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
