# DatabaseInstanceAttributes

Properties that describe an existing instance.

- Source: [`aws-rds/lib/instance.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-rds/lib/instance.ts#L109)
- Type last changed: v2.77.0 · 26 Apr 2023

## Example

TypeScript:

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

declare const instanceEngine: rds.IInstanceEngine;
declare const securityGroup: ec2.SecurityGroup;
const databaseInstanceAttributes: rds.DatabaseInstanceAttributes = {
  instanceEndpointAddress: 'instanceEndpointAddress',
  instanceIdentifier: 'instanceIdentifier',
  port: 123,
  securityGroups: [securityGroup],

  // the properties below are optional
  engine: instanceEngine,
  instanceResourceId: 'instanceResourceId',
};
```

Python:

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

# instance_engine: rds.IInstanceEngine
# security_group: ec2.SecurityGroup

database_instance_attributes = rds.DatabaseInstanceAttributes(
    instance_endpoint_address="instanceEndpointAddress",
    instance_identifier="instanceIdentifier",
    port=123,
    security_groups=[security_group],

    # the properties below are optional
    engine=instance_engine,
    instance_resource_id="instanceResourceId"
)
```

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.services.ec2.*;
import software.amazon.awscdk.services.rds.*;

IInstanceEngine instanceEngine;
SecurityGroup securityGroup;

DatabaseInstanceAttributes databaseInstanceAttributes = DatabaseInstanceAttributes.builder()
        .instanceEndpointAddress("instanceEndpointAddress")
        .instanceIdentifier("instanceIdentifier")
        .port(123)
        .securityGroups(List.of(securityGroup))

        // the properties below are optional
        .engine(instanceEngine)
        .instanceResourceId("instanceResourceId")
        .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.AWS.EC2;
using Amazon.CDK.AWS.RDS;

IInstanceEngine instanceEngine;
SecurityGroup securityGroup;

var databaseInstanceAttributes = new DatabaseInstanceAttributes {
    InstanceEndpointAddress = "instanceEndpointAddress",
    InstanceIdentifier = "instanceIdentifier",
    Port = 123,
    SecurityGroups = new [] { securityGroup },

    // the properties below are optional
    Engine = instanceEngine,
    InstanceResourceId = "instanceResourceId"
};
```

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 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var instanceEngine IInstanceEngine
var securityGroup SecurityGroup

databaseInstanceAttributes := &DatabaseInstanceAttributes{
	InstanceEndpointAddress: jsii.String("instanceEndpointAddress"),
	InstanceIdentifier: jsii.String("instanceIdentifier"),
	Port: jsii.Number(123),
	SecurityGroups: []ISecurityGroup{
		securityGroup,
	},

	// the properties below are optional
	Engine: instanceEngine,
	InstanceResourceId: jsii.String("instanceResourceId"),
}
```

## Properties

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

  **Default:** the imported Instance's engine is unknown

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

- `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.

- `port`: number (required) — The database port.

- `securityGroups`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html)[] (required) — The security groups of the instance.
