Skip to content
v2.278.0

ZoneAwarenessConfig ​

Struct Deprecated

Deprecated: use opensearchservice module instead

Specifies zone awareness configuration options.

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,
  },
});
python
prod_domain = es.Domain(self, "Domain",
    version=es.ElasticsearchVersion.V7_1,
    capacity=es.CapacityConfig(
        master_nodes=5,
        data_nodes=20
    ),
    ebs=es.EbsOptions(
        volume_size=20
    ),
    zone_awareness=es.ZoneAwarenessConfig(
        availability_zone_count=3
    ),
    logging=es.LoggingOptions(
        slow_search_log_enabled=True,
        app_log_enabled=True,
        slow_index_log_enabled=True
    )
)
java
Domain prodDomain = Domain.Builder.create(this, "Domain")
        .version(ElasticsearchVersion.V7_1)
        .capacity(CapacityConfig.builder()
                .masterNodes(5)
                .dataNodes(20)
                .build())
        .ebs(EbsOptions.builder()
                .volumeSize(20)
                .build())
        .zoneAwareness(ZoneAwarenessConfig.builder()
                .availabilityZoneCount(3)
                .build())
        .logging(LoggingOptions.builder()
                .slowSearchLogEnabled(true)
                .appLogEnabled(true)
                .slowIndexLogEnabled(true)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var prodDomain = new Domain(this, "Domain", new DomainProps {
    Version = ElasticsearchVersion.V7_1,
    Capacity = new CapacityConfig {
        MasterNodes = 5,
        DataNodes = 20
    },
    Ebs = new EbsOptions {
        VolumeSize = 20
    },
    ZoneAwareness = new ZoneAwarenessConfig {
        AvailabilityZoneCount = 3
    },
    Logging = new LoggingOptions {
        SlowSearchLogEnabled = true,
        AppLogEnabled = true,
        SlowIndexLogEnabled = true
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
prodDomain := es.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: es.ElasticsearchVersion_V7_1(),
	Capacity: &CapacityConfig{
		MasterNodes: jsii.Number(5),
		DataNodes: jsii.Number(20),
	},
	Ebs: &EbsOptions{
		VolumeSize: jsii.Number(20),
	},
	ZoneAwareness: &ZoneAwarenessConfig{
		AvailabilityZoneCount: jsii.Number(3),
	},
	Logging: &LoggingOptions{
		SlowSearchLogEnabled: jsii.Boolean(true),
		AppLogEnabled: jsii.Boolean(true),
		SlowIndexLogEnabled: jsii.Boolean(true),
	},
})

Properties ​

availabilityZoneCountoptionalnumberavailability_zone_countoptionalint | floatavailabilityZoneCountoptionalNumberAvailabilityZoneCountoptionaldoubleAvailabilityZoneCountoptional*float64 deprecated #
use opensearchservice module instead

Default: 2 if zone awareness is enabled.

Valid values are 2 and 3.

enabledoptionalbooleanenabledoptionalboolenabledoptionalBooleanEnabledoptionalboolEnabledoptional*bool = false deprecated #
use opensearchservice module instead
notes

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.