# ZoneAwarenessConfig

Specifies zone awareness configuration options.

- Source: [`aws-elasticsearch/lib/domain.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-elasticsearch/lib/domain.ts#L212)
- Type last changed: v2.17.0 · 17 Mar 2022

## Example

```ts
const prodDomain = new es.Domain(this, 'Domain', {
  version: es.ElasticsearchVersion.V7_1,
  capacity: {
    masterNodes: 5,
    dataNodes: 20,
  },
  ebs: {
    volumeSize: 20,
  },
  zoneAwareness: {
    availabilityZoneCount: 3,
  },
  logging: {
    slowSearchLogEnabled: true,
    appLogEnabled: true,
    slowIndexLogEnabled: true,
  },
});
```

## Properties

- `availabilityZoneCount`: number — use opensearchservice module instead

  **Default:** 2 if zone awareness is enabled.

  Valid values are 2 and 3.

- `enabled`: boolean = false — use opensearchservice module instead

  When you enable zone awareness, Amazon ES allocates the nodes and replica
  index shards that belong to a cluster across two Availability Zones (AZs)
  in the same region to prevent data loss and minimize downtime in the event
  of node or data center failure. Don't enable zone awareness if your cluster
  has no replica index shards or is a single-node cluster. For more information,
  see [Configuring a Multi-AZ Domain]
  (https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-managedomains-multiaz)
  in the Amazon Elasticsearch Service Developer Guide.
