# DatabaseClusterAttributes

Properties that describe an existing cluster instance.

Used as argument in: [DatabaseCluster.fromDatabaseClusterAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_docdb.DatabaseCluster.html#fromdatabaseclusterattributes)

- Source: [`aws-docdb/lib/cluster-ref.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-docdb/lib/cluster-ref.ts#L47)
- Type last changed: v2.21.0 · 22 Apr 2022

## Example

TypeScript:

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

declare const securityGroup: ec2.SecurityGroup;
const databaseClusterAttributes: docdb.DatabaseClusterAttributes = {
  clusterIdentifier: 'clusterIdentifier',

  // the properties below are optional
  clusterEndpointAddress: 'clusterEndpointAddress',
  instanceEndpointAddresses: ['instanceEndpointAddresses'],
  instanceIdentifiers: ['instanceIdentifiers'],
  port: 123,
  readerEndpointAddress: 'readerEndpointAddress',
  securityGroup: securityGroup,
};
```

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_docdb as docdb
from aws_cdk import aws_ec2 as ec2

# security_group: ec2.SecurityGroup

database_cluster_attributes = docdb.DatabaseClusterAttributes(
    cluster_identifier="clusterIdentifier",

    # the properties below are optional
    cluster_endpoint_address="clusterEndpointAddress",
    instance_endpoint_addresses=["instanceEndpointAddresses"],
    instance_identifiers=["instanceIdentifiers"],
    port=123,
    reader_endpoint_address="readerEndpointAddress",
    security_group=security_group
)
```

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

SecurityGroup securityGroup;

DatabaseClusterAttributes databaseClusterAttributes = DatabaseClusterAttributes.builder()
        .clusterIdentifier("clusterIdentifier")

        // the properties below are optional
        .clusterEndpointAddress("clusterEndpointAddress")
        .instanceEndpointAddresses(List.of("instanceEndpointAddresses"))
        .instanceIdentifiers(List.of("instanceIdentifiers"))
        .port(123)
        .readerEndpointAddress("readerEndpointAddress")
        .securityGroup(securityGroup)
        .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.DocDB;
using Amazon.CDK.AWS.EC2;

SecurityGroup securityGroup;

var databaseClusterAttributes = new DatabaseClusterAttributes {
    ClusterIdentifier = "clusterIdentifier",

    // the properties below are optional
    ClusterEndpointAddress = "clusterEndpointAddress",
    InstanceEndpointAddresses = new [] { "instanceEndpointAddresses" },
    InstanceIdentifiers = new [] { "instanceIdentifiers" },
    Port = 123,
    ReaderEndpointAddress = "readerEndpointAddress",
    SecurityGroup = securityGroup
};
```

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 securityGroup SecurityGroup

databaseClusterAttributes := &DatabaseClusterAttributes{
	ClusterIdentifier: jsii.String("clusterIdentifier"),

	// the properties below are optional
	ClusterEndpointAddress: jsii.String("clusterEndpointAddress"),
	InstanceEndpointAddresses: []*string{
		jsii.String("instanceEndpointAddresses"),
	},
	InstanceIdentifiers: []*string{
		jsii.String("instanceIdentifiers"),
	},
	Port: jsii.Number(123),
	ReaderEndpointAddress: jsii.String("readerEndpointAddress"),
	SecurityGroup: securityGroup,
}
```

## Properties

- `clusterEndpointAddress`: string — Cluster endpoint address.

  **Default:** no cluster endpoint address

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

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

  **Default:** no instance endpoint addresses

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

  **Default:** no instance identifiers

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

- `readerEndpointAddress`: string — Reader endpoint address.

  **Default:** no reader endpoint address

- `securityGroup`: [ISecurityGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html) — The security group of the database cluster.

  **Default:** no security groups
