# DatabaseClusterAttributes

Properties that describe an existing cluster instance.

- Source: [`aws-rds/lib/cluster-ref.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-rds/lib/cluster-ref.ts#L84)
- Type last changed: v2.162.0 · 10 Oct 2024

## Example

```ts
declare const vpc: ec2.Vpc;
declare const fn: lambda.Function;
declare const secret: secretsmanager.Secret;

// Create a serverless V1 cluster
const serverlessV1Cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
  engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
  vpc, // this parameter is optional for serverless Clusters
  enableDataApi: true, // Optional - will be automatically set if you call grantDataApiAccess()
});
serverlessV1Cluster.grantDataApiAccess(fn);

// Create an Aurora cluster
const cluster = new rds.DatabaseCluster(this, 'Cluster', {
  engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
  vpc,
  enableDataApi: true, // Optional - will be automatically set if you call grantDataApiAccess()
});
cluster.grantDataApiAccess(fn);

// Import an Aurora cluster
const importedCluster = rds.DatabaseCluster.fromDatabaseClusterAttributes(this, 'ImportedCluster', {
  clusterIdentifier: 'clusterIdentifier',
  secret,
  dataApiEnabled: true,
});
importedCluster.grantDataApiAccess(fn);
```

## Properties

- `clusterEndpointAddress`: string — Cluster endpoint address.

  **Default:** no endpoint address

- `clusterIdentifier`: string (required) — Identifier for the cluster.

- `clusterResourceIdentifier`: string = none — The immutable identifier for the cluster; for example: cluster-ABCD1234EFGH5678IJKL90MNOP.

  This AWS Region-unique identifier is used to grant access to the cluster.

- `dataApiEnabled`: boolean = false — Whether the Data API for the cluster is enabled.

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

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

- `instanceEndpointAddresses`: string[] — Endpoint addresses of individual instances.

  **Default:** no instance endpoints

- `instanceIdentifiers`: string[] — Identifier for the instances.

  **Default:** no instance identifiers

- `port`: number = none — The database port.

- `readerEndpointAddress`: string — Reader endpoint address.

  **Default:** no reader address

- `secret`: [ISecret](/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) — The secret attached to the database cluster.

  **Default:** the imported Cluster's secret is unknown

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

  **Default:** no security groups
