AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::Elasticsearch::Domain

CfnDomain

The AWS::Elasticsearch::Domain resource creates an Amazon OpenSearch Service domain. > The `AWS::Elasticsearch::Domain` resource is being replaced by the [AWS::OpenSearchService::Domain](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchservice-domain.html) resource. While the legacy Elasticsearch resource and options are still supported, we recommend modifying your existing Cloudformation templates to use the new OpenSearch Service resource, which supports both OpenSearch and legacy Elasticsearch. For instructions to upgrade domains defined within CloudFormation from Elasticsearch to OpenSearch, see [Remarks](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchservice-domain.html#aws-resource-opensearchservice-domain--remarks) .

Import

import { CfnDomain } from 'aws-cdk-lib/aws-elasticsearch';

Or use the module namespace:

import * as elasticsearch from 'aws-cdk-lib/aws-elasticsearch';
// elasticsearch.CfnDomain

Properties

Configuration passed to the constructor as CfnDomainProps.

accessPoliciesOptional
any

An AWS Identity and Access Management ( IAM ) policy document that specifies who can access the OpenSearch Service domain and their permissions. For more information, see [Configuring access policies](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ac.html#ac-creating) in the *Amazon OpenSearch Service Developer Guid* e.

advancedOptionsOptional
{ [key: string]: string } | IResolvable

Additional options to specify for the OpenSearch Service domain. For more information, see [Advanced cluster parameters](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options) in the *Amazon OpenSearch Service Developer Guide* .

advancedSecurityOptionsOptional
IResolvable | AdvancedSecurityOptionsInputProperty

Specifies options for fine-grained access control.

cognitoOptionsOptional
IResolvable | CognitoOptionsProperty

Configures OpenSearch Service to use Amazon Cognito authentication for OpenSearch Dashboards.

domainArnOptional
string
domainEndpointOptionsOptional
IResolvable | DomainEndpointOptionsProperty

Specifies additional options for the domain endpoint, such as whether to require HTTPS for all traffic or whether to use a custom endpoint rather than the default endpoint.

domainNameOptional
string

A name for the OpenSearch Service domain. For valid values, see the [DomainName](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/configuration-api.html#configuration-api-datatypes-domainname) data type in the *Amazon OpenSearch Service Developer Guide* . If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the domain name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) . > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

ebsOptionsOptional
IResolvable | EBSOptionsProperty

The configurations of Amazon Elastic Block Store (Amazon EBS) volumes that are attached to data nodes in the OpenSearch Service domain. For more information, see [EBS volume size limits](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/limits.html#ebsresource) in the *Amazon OpenSearch Service Developer Guide* .

elasticsearchClusterConfigOptional
IResolvable | ElasticsearchClusterConfigProperty

ElasticsearchClusterConfig is a property of the AWS::Elasticsearch::Domain resource that configures the cluster of an Amazon OpenSearch Service domain.

elasticsearchVersionOptional
string

The version of Elasticsearch to use, such as 2.3. If not specified, 1.5 is used as the default. For information about the versions that OpenSearch Service supports, see [Supported versions of OpenSearch and Elasticsearch](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/what-is.html#choosing-version) in the *Amazon OpenSearch Service Developer Guide* . If you set the [EnableVersionUpgrade](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-upgradeopensearchdomain) update policy to `true` , you can update `ElasticsearchVersion` without interruption. When `EnableVersionUpgrade` is set to `false` , or is not specified, updating `ElasticsearchVersion` results in [replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) .

encryptionAtRestOptionsOptional
IResolvable | EncryptionAtRestOptionsProperty

Whether the domain should encrypt data at rest, and if so, the AWS Key Management Service key to use. See [Encryption of data at rest for Amazon OpenSearch Service](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/encryption-at-rest.html) .

logPublishingOptionsOptional
IResolvable | { [key: string]: IResolvable | LogPublishingOptionProperty }

An object with one or more of the following keys: `SEARCH_SLOW_LOGS` , `ES_APPLICATION_LOGS` , `INDEX_SLOW_LOGS` , `AUDIT_LOGS` , depending on the types of logs you want to publish. Each key needs a valid `LogPublishingOption` value.

nodeToNodeEncryptionOptionsOptional
IResolvable | NodeToNodeEncryptionOptionsProperty

Specifies whether node-to-node encryption is enabled. See [Node-to-node encryption for Amazon OpenSearch Service](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ntn.html) .

snapshotOptionsOptional
IResolvable | SnapshotOptionsProperty

*DEPRECATED* . The automated snapshot configuration for the OpenSearch Service domain indices.

tagsOptional
CfnTag[]

An arbitrary set of tags (key–value pairs) to associate with the OpenSearch Service domain.

vpcOptionsOptional
IResolvable | VPCOptionsProperty

The virtual private cloud (VPC) configuration for the OpenSearch Service domain. For more information, see [Launching your Amazon OpenSearch Service domains within a VPC](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html) in the *Amazon OpenSearch Service Developer Guide* .

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-elasticsearch
CFN TypeAWS::Elasticsearch::Domain
Properties16

Related Constructs

External Links