# CapacityConfig

Configures the capacity of the cluster such as the instance type and the number of instances.

- Source: [`aws-opensearchservice/lib/domain.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts#L34)
- Type last changed: v2.182.0 · 5 Mar 2025

## Example

```ts
import * as opensearch from 'aws-cdk-lib/aws-opensearchservice';

const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_3,
  capacity: {
    nodeOptions: [
      {
        nodeType: opensearch.NodeType.COORDINATOR,
        nodeConfig: {
          enabled: true,
          count: 2,
          type: 'm5.large.search',
        },
      },
    ],
  },
})
```

## Properties

- `dataNodeInstanceType`: string = r5.large.search — The instance type for your data nodes, such as `m3.medium.search`. For valid values, see [Supported Instance Types](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-instance-types.html) in the Amazon OpenSearch Service Developer Guide.

- `dataNodes`: number = 1 — The number of data nodes (instances) to use in the Amazon OpenSearch Service domain.

- `masterNodeInstanceType`: string = r5.large.search — The hardware configuration of the computer that hosts the dedicated master node, such as `m3.medium.search`. For valid values, see [Supported Instance Types](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-instance-types.html) in the Amazon OpenSearch Service Developer Guide.

- `masterNodes`: number — The number of instances to use for the master node.

  **Default:** no dedicated master nodes

- `multiAzWithStandbyEnabled`: boolean — Indicates whether Multi-AZ with Standby deployment option is enabled.

  **Default:** multi-az with standby if the feature flag `ENABLE_OPENSEARCH_MULTIAZ_WITH_STANDBY` is true, no multi-az with standby otherwise

  For more information, see [Multi-AZ with
  Standby](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html#managedomains-za-standby)

- `nodeOptions`: [NodeOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchservice.NodeOptions.html)[] — Additional node options for the domain.

  **Default:** no additional node options

- `warmInstanceType`: string = ultrawarm1.medium.search — The instance type for your UltraWarm node, such as `ultrawarm1.medium.search`. For valid values, see [UltraWarm Storage Limits](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/limits.html#limits-ultrawarm) in the Amazon OpenSearch Service Developer Guide.

- `warmNodes`: number — The number of UltraWarm nodes (instances) to use in the Amazon OpenSearch Service domain.

  **Default:** no UltraWarm nodes
