Skip to content
v2.277.0

Amazon OpenSearch Service Construct Library ​

See Migrating to OpenSearch for migration instructions from aws-cdk-lib/aws-elasticsearch to this module, aws-cdk-lib/aws-opensearchservice.

Quick start ​

Create a development cluster by simply specifying the version:

ts
const devDomain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
});
python
dev_domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0
)
java
Domain devDomain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .build();
csharp
var devDomain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0
});
go
devDomain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
})

To perform version upgrades without replacing the entire domain, specify the enableVersionUpgrade property.

ts
const devDomain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  enableVersionUpgrade: true, // defaults to false
});
python
dev_domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    enable_version_upgrade=True
)
java
Domain devDomain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .enableVersionUpgrade(true)
        .build();
csharp
var devDomain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    EnableVersionUpgrade = true
});
go
devDomain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	EnableVersionUpgrade: jsii.Boolean(true),
})

Create a cluster with GP3 volumes:

ts
const gp3Domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_2_5,
  ebs: {
    volumeSize: 30,
    volumeType: ec2.EbsDeviceVolumeType.GP3,
    throughput: 125,
    iops: 3000,
  },
});
python
from aws_cdk.aws_opensearchservice import EbsOptions
gp3_domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_2_5,
    ebs=EbsOptions(
        volume_size=30,
        volume_type=ec2.EbsDeviceVolumeType.GP3,
        throughput=125,
        iops=3000
    )
)
java
Domain gp3Domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_2_5)
        .ebs(EbsOptions.builder()
                .volumeSize(30)
                .volumeType(EbsDeviceVolumeType.GP3)
                .throughput(125)
                .iops(3000)
                .build())
        .build();
csharp
var gp3Domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_2_5,
    Ebs = new EbsOptions {
        VolumeSize = 30,
        VolumeType = EbsDeviceVolumeType.GP3,
        Throughput = 125,
        Iops = 3000
    }
});
go
gp3Domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_2_5(),
	Ebs: &EbsOptions{
		VolumeSize: jsii.Number(30),
		VolumeType: ec2.EbsDeviceVolumeType_GP3,
		Throughput: jsii.Number(125),
		Iops: jsii.Number(3000),
	},
})

Create a production grade cluster by also specifying things like capacity and az distribution

ts
const prodDomain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  capacity: {
    masterNodes: 5,
    dataNodes: 20,
  },
  ebs: {
    volumeSize: 20,
  },
  zoneAwareness: {
    availabilityZoneCount: 3,
  },
  logging: {
    slowSearchLogEnabled: true,
    appLogEnabled: true,
    slowIndexLogEnabled: true,
  },
});
python
from aws_cdk.aws_opensearchservice import CapacityConfig, EbsOptions, ZoneAwarenessConfig, LoggingOptions
prod_domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    capacity=CapacityConfig(
        master_nodes=5,
        data_nodes=20
    ),
    ebs=EbsOptions(
        volume_size=20
    ),
    zone_awareness=ZoneAwarenessConfig(
        availability_zone_count=3
    ),
    logging=LoggingOptions(
        slow_search_log_enabled=True,
        app_log_enabled=True,
        slow_index_log_enabled=True
    )
)
java
Domain prodDomain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .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
var prodDomain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    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
prodDomain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	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),
	},
})

This creates an Amazon OpenSearch Service cluster and automatically sets up log groups for logging the domain logs and slow search logs.

A note about SLR ​

Some cluster configurations (e.g VPC access) require the existence of the AWSServiceRoleForAmazonElasticsearchService Service-Linked Role.

When performing such operations via the AWS Console, this SLR is created automatically when needed. However, this is not the behavior when using CloudFormation. If an SLR is needed, but doesn't exist, you will encounter a failure message similar to:

console
Before you can proceed, you must enable a service-linked role to give Amazon OpenSearch Service...

To resolve this, you need to create the SLR. We recommend using the AWS CLI:

console
aws iam create-service-linked-role --aws-service-name es.amazonaws.com

You can also create it using the CDK, but note that only the first application deploying this will succeed:

ts
const slr = new iam.CfnServiceLinkedRole(this, 'Service Linked Role', {
  awsServiceName: 'es.amazonaws.com',
});
python
slr = iam.CfnServiceLinkedRole(self, "Service Linked Role",
    aws_service_name="es.amazonaws.com"
)
java
CfnServiceLinkedRole slr = CfnServiceLinkedRole.Builder.create(this, "Service Linked Role")
        .awsServiceName("es.amazonaws.com")
        .build();
csharp
var slr = new CfnServiceLinkedRole(this, "Service Linked Role", new CfnServiceLinkedRoleProps {
    AwsServiceName = "es.amazonaws.com"
});
go
slr := iam.NewCfnServiceLinkedRole(this, jsii.String("Service Linked Role"), &CfnServiceLinkedRoleProps{
	AwsServiceName: jsii.String("es.amazonaws.com"),
})

Importing existing domains ​

Using a known domain endpoint ​

To import an existing domain into your CDK application, use the Domain.fromDomainEndpoint factory method. This method accepts a domain endpoint of an already existing domain:

ts
const domainEndpoint = 'https://my-domain-jcjotrt6f7otem4sqcwbch3c4u.us-east-1.es.amazonaws.com';
const domain = Domain.fromDomainEndpoint(this, 'ImportedDomain', domainEndpoint);
python
domain_endpoint = "https://my-domain-jcjotrt6f7otem4sqcwbch3c4u.us-east-1.es.amazonaws.com"
domain = Domain.from_domain_endpoint(self, "ImportedDomain", domain_endpoint)
java
String domainEndpoint = "https://my-domain-jcjotrt6f7otem4sqcwbch3c4u.us-east-1.es.amazonaws.com";
IDomain domain = Domain.fromDomainEndpoint(this, "ImportedDomain", domainEndpoint);
csharp
var domainEndpoint = "https://my-domain-jcjotrt6f7otem4sqcwbch3c4u.us-east-1.es.amazonaws.com";
var domain = Domain.FromDomainEndpoint(this, "ImportedDomain", domainEndpoint);
go
domainEndpoint := "https://my-domain-jcjotrt6f7otem4sqcwbch3c4u.us-east-1.es.amazonaws.com"
domain := awscdk.Domain_FromDomainEndpoint(this, jsii.String("ImportedDomain"), domainEndpoint)

Using the output of another CloudFormation stack ​

To import an existing domain with the help of an exported value from another CloudFormation stack, use the Domain.fromDomainAttributes factory method. This will accept tokens.

ts
const domainArn = Fn.importValue(`another-cf-stack-export-domain-arn`);
const domainEndpoint = Fn.importValue(`another-cf-stack-export-domain-endpoint`);
const domain = Domain.fromDomainAttributes(this, 'ImportedDomain', {
  domainArn,
  domainEndpoint,
});
python
domain_arn = Fn.import_value("another-cf-stack-export-domain-arn")
domain_endpoint = Fn.import_value("another-cf-stack-export-domain-endpoint")
domain = Domain.from_domain_attributes(self, "ImportedDomain",
    domain_arn=domain_arn,
    domain_endpoint=domain_endpoint
)
java
String domainArn = Fn.importValue("another-cf-stack-export-domain-arn");
String domainEndpoint = Fn.importValue("another-cf-stack-export-domain-endpoint");
IDomain domain = Domain.fromDomainAttributes(this, "ImportedDomain", DomainAttributes.builder()
        .domainArn(domainArn)
        .domainEndpoint(domainEndpoint)
        .build());
csharp
var domainArn = Fn.ImportValue("another-cf-stack-export-domain-arn");
var domainEndpoint = Fn.ImportValue("another-cf-stack-export-domain-endpoint");
var domain = Domain.FromDomainAttributes(this, "ImportedDomain", new DomainAttributes {
    DomainArn = domainArn,
    DomainEndpoint = domainEndpoint
});
go
domainArn := awscdk.Fn_ImportValue(jsii.String("another-cf-stack-export-domain-arn"))
domainEndpoint := awscdk.Fn_ImportValue(jsii.String("another-cf-stack-export-domain-endpoint"))
domain := awscdk.Domain_FromDomainAttributes(this, jsii.String("ImportedDomain"), &DomainAttributes{
	DomainArn: jsii.String(DomainArn),
	DomainEndpoint: jsii.String(DomainEndpoint),
})

Permissions ​

IAM ​

Helper methods also exist for managing access to the domain.

ts
declare const fn: lambda.Function;
declare const domain: Domain;

// Grant write access to the app-search index
domain.grantIndexWrite('app-search', fn);

// Grant read access to the 'app-search/_search' path
domain.grantPathRead('app-search/_search', fn);
python
# fn: lambda.Function
# domain: Domain


# Grant write access to the app-search index
domain.grant_index_write("app-search", fn)

# Grant read access to the 'app-search/_search' path
domain.grant_path_read("app-search/_search", fn)
java
Function fn;
Domain domain;


// Grant write access to the app-search index
domain.grantIndexWrite("app-search", fn);

// Grant read access to the 'app-search/_search' path
domain.grantPathRead("app-search/_search", fn);
csharp
Function fn;
Domain domain;


// Grant write access to the app-search index
domain.GrantIndexWrite("app-search", fn);

// Grant read access to the 'app-search/_search' path
domain.GrantPathRead("app-search/_search", fn);
go
var fn Function
var domain Domain


// Grant write access to the app-search index
domain.grantIndexWrite(jsii.String("app-search"), fn)

// Grant read access to the 'app-search/_search' path
domain.grantPathRead(jsii.String("app-search/_search"), fn)

Encryption ​

The domain can also be created with encryption enabled:

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  ebs: {
    volumeSize: 100,
    volumeType: ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD,
  },
  nodeToNodeEncryption: true,
  encryptionAtRest: {
    enabled: true,
  },
});
python
from aws_cdk.aws_opensearchservice import EbsOptions, EncryptionAtRestOptions
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    ebs=EbsOptions(
        volume_size=100,
        volume_type=ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD
    ),
    node_to_node_encryption=True,
    encryption_at_rest=EncryptionAtRestOptions(
        enabled=True
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .ebs(EbsOptions.builder()
                .volumeSize(100)
                .volumeType(EbsDeviceVolumeType.GENERAL_PURPOSE_SSD)
                .build())
        .nodeToNodeEncryption(true)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    Ebs = new EbsOptions {
        VolumeSize = 100,
        VolumeType = EbsDeviceVolumeType.GENERAL_PURPOSE_SSD
    },
    NodeToNodeEncryption = true,
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	Ebs: &EbsOptions{
		VolumeSize: jsii.Number(100),
		VolumeType: ec2.EbsDeviceVolumeType_GENERAL_PURPOSE_SSD,
	},
	NodeToNodeEncryption: jsii.Boolean(true),
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
})

This sets up the domain with node to node encryption and encryption at rest. You can also choose to supply your own KMS key to use for encryption at rest:

ts
import * as kms from 'aws-cdk-lib/aws-kms';

const encryptionKey = new kms.Key(this, 'EncryptionKey');

const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  encryptionAtRest: {
    kmsKey: encryptionKey,
  },
});
python
from aws_cdk.aws_opensearchservice import EncryptionAtRestOptions
import aws_cdk.aws_kms as kms


encryption_key = kms.Key(self, "EncryptionKey")

domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    encryption_at_rest=EncryptionAtRestOptions(
        kms_key=encryption_key
    )
)
java
import software.amazon.awscdk.services.kms.*;


Key encryptionKey = new Key(this, "EncryptionKey");

Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .kmsKey(encryptionKey)
                .build())
        .build();
csharp
using Amazon.CDK.AWS.KMS;


var encryptionKey = new Key(this, "EncryptionKey");

var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    EncryptionAtRest = new EncryptionAtRestOptions {
        KmsKey = encryptionKey
    }
});
go
import kms "github.com/aws/aws-cdk-go/awscdk"


encryptionKey := kms.NewKey(this, jsii.String("EncryptionKey"))

domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	EncryptionAtRest: &EncryptionAtRestOptions{
		KmsKey: encryptionKey,
	},
})

The construct also supports using cross-account KMS keys for encryption at rest:

ts
import * as kms from 'aws-cdk-lib/aws-kms';

const crossAccountKey = kms.Key.fromKeyArn(
  this,
  'CrossAccountKey',
  'arn:aws:kms:us-east-1:111111111111:key/12345678-1234-1234-1234-123456789012',
);

const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  encryptionAtRest: {
    kmsKey: crossAccountKey,
  },
});
python
from aws_cdk.aws_opensearchservice import EncryptionAtRestOptions
import aws_cdk.aws_kms as kms


cross_account_key = kms.Key.from_key_arn(self, "CrossAccountKey", "arn:aws:kms:us-east-1:111111111111:key/12345678-1234-1234-1234-123456789012")

domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    encryption_at_rest=EncryptionAtRestOptions(
        kms_key=cross_account_key
    )
)
java
import software.amazon.awscdk.services.kms.*;


IKey crossAccountKey = Key.fromKeyArn(this, "CrossAccountKey", "arn:aws:kms:us-east-1:111111111111:key/12345678-1234-1234-1234-123456789012");

Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .kmsKey(crossAccountKey)
                .build())
        .build();
csharp
using Amazon.CDK.AWS.KMS;


var crossAccountKey = Key.FromKeyArn(this, "CrossAccountKey", "arn:aws:kms:us-east-1:111111111111:key/12345678-1234-1234-1234-123456789012");

var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    EncryptionAtRest = new EncryptionAtRestOptions {
        KmsKey = crossAccountKey
    }
});
go
import kms "github.com/aws/aws-cdk-go/awscdk"


crossAccountKey := kms.Key_FromKeyArn(this, jsii.String("CrossAccountKey"), jsii.String("arn:aws:kms:us-east-1:111111111111:key/12345678-1234-1234-1234-123456789012"))

domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	EncryptionAtRest: &EncryptionAtRestOptions{
		KmsKey: crossAccountKey,
	},
})

VPC Support ​

Domains can be placed inside a VPC, providing a secure communication between Amazon OpenSearch Service and other services within the VPC without the need for an internet gateway, NAT device, or VPN connection.

Visit VPC Support for Amazon OpenSearch Service Domains for more details.

ts
const vpc = new ec2.Vpc(this, 'Vpc');
const domainProps: DomainProps = {
  version: EngineVersion.OPENSEARCH_1_0,
  removalPolicy: RemovalPolicy.DESTROY,
  vpc,
  // must be enabled since our VPC contains multiple private subnets.
  zoneAwareness: {
    enabled: true,
  },
  capacity: {
    // must be an even number since the default az count is 2.
    dataNodes: 2,
  },
};
new Domain(this, 'Domain', domainProps);
python
from aws_cdk.aws_opensearchservice import DomainProps, ZoneAwarenessConfig, CapacityConfig
vpc = ec2.Vpc(self, "Vpc")
domain_props = DomainProps(
    version=EngineVersion.OPENSEARCH_1_0,
    removal_policy=RemovalPolicy.DESTROY,
    vpc=vpc,
    # must be enabled since our VPC contains multiple private subnets.
    zone_awareness=ZoneAwarenessConfig(
        enabled=True
    ),
    capacity=CapacityConfig(
        # must be an even number since the default az count is 2.
        data_nodes=2
    )
)
Domain(self, "Domain", domain_props)
java
Vpc vpc = new Vpc(this, "Vpc");
DomainProps domainProps = DomainProps.builder()
        .version(EngineVersion.OPENSEARCH_1_0)
        .removalPolicy(RemovalPolicy.DESTROY)
        .vpc(vpc)
        // must be enabled since our VPC contains multiple private subnets.
        .zoneAwareness(ZoneAwarenessConfig.builder()
                .enabled(true)
                .build())
        .capacity(CapacityConfig.builder()
                // must be an even number since the default az count is 2.
                .dataNodes(2)
                .build())
        .build();
new Domain(this, "Domain", domainProps);
csharp
var vpc = new Vpc(this, "Vpc");
var domainProps = new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    RemovalPolicy = RemovalPolicy.DESTROY,
    Vpc = vpc,
    // must be enabled since our VPC contains multiple private subnets.
    ZoneAwareness = new ZoneAwarenessConfig {
        Enabled = true
    },
    Capacity = new CapacityConfig {
        // must be an even number since the default az count is 2.
        DataNodes = 2
    }
};
new Domain(this, "Domain", domainProps);
go
vpc := ec2.NewVpc(this, jsii.String("Vpc"))
domainProps := &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	RemovalPolicy: awscdk.RemovalPolicy_DESTROY,
	Vpc: Vpc,
	// must be enabled since our VPC contains multiple private subnets.
	ZoneAwareness: &ZoneAwarenessConfig{
		Enabled: jsii.Boolean(true),
	},
	Capacity: &CapacityConfig{
		// must be an even number since the default az count is 2.
		DataNodes: jsii.Number(2),
	},
}
awscdk.NewDomain(this, jsii.String("Domain"), domainProps)

In addition, you can use the vpcSubnets property to control which specific subnets will be used, and the securityGroups property to control which security groups will be attached to the domain. By default, CDK will select all private subnets in the VPC, and create one dedicated security group.

Metrics ​

Helper methods exist to access common domain metrics for example:

ts
declare const domain: Domain;
const freeStorageSpace = domain.metricFreeStorageSpace();
const masterSysMemoryUtilization = domain.metric('MasterSysMemoryUtilization');
python
# domain: Domain

free_storage_space = domain.metric_free_storage_space()
master_sys_memory_utilization = domain.metric("MasterSysMemoryUtilization")
java
Domain domain;

Metric freeStorageSpace = domain.metricFreeStorageSpace();
Metric masterSysMemoryUtilization = domain.metric("MasterSysMemoryUtilization");
csharp
Domain domain;

var freeStorageSpace = domain.MetricFreeStorageSpace();
var masterSysMemoryUtilization = domain.Metric("MasterSysMemoryUtilization");
go
var domain Domain

freeStorageSpace := domain.metricFreeStorageSpace()
masterSysMemoryUtilization := domain.metric(jsii.String("MasterSysMemoryUtilization"))

This module is part of the AWS Cloud Development Kit project.

Fine grained access control ​

The domain can also be created with a master user configured. The password can be supplied or dynamically created if not supplied.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  enforceHttps: true,
  nodeToNodeEncryption: true,
  encryptionAtRest: {
    enabled: true,
  },
  fineGrainedAccessControl: {
    masterUserName: 'master-user',
  },
});

const masterUserPassword = domain.masterUserPassword;
python
from aws_cdk.aws_opensearchservice import EncryptionAtRestOptions, AdvancedSecurityOptions
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    enforce_https=True,
    node_to_node_encryption=True,
    encryption_at_rest=EncryptionAtRestOptions(
        enabled=True
    ),
    fine_grained_access_control=AdvancedSecurityOptions(
        master_user_name="master-user"
    )
)

master_user_password = domain.master_user_password
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .enforceHttps(true)
        .nodeToNodeEncryption(true)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .fineGrainedAccessControl(AdvancedSecurityOptions.builder()
                .masterUserName("master-user")
                .build())
        .build();

SecretValue masterUserPassword = domain.getMasterUserPassword();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    EnforceHttps = true,
    NodeToNodeEncryption = true,
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    },
    FineGrainedAccessControl = new AdvancedSecurityOptions {
        MasterUserName = "master-user"
    }
});

var masterUserPassword = domain.MasterUserPassword;
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	EnforceHttps: jsii.Boolean(true),
	NodeToNodeEncryption: jsii.Boolean(true),
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
	FineGrainedAccessControl: &AdvancedSecurityOptions{
		MasterUserName: jsii.String("master-user"),
	},
})

masterUserPassword := domain.MasterUserPassword

SAML authentication ​

You can enable SAML authentication to use your existing identity provider to offer single sign-on (SSO) for dashboards on Amazon OpenSearch Service domains running OpenSearch or Elasticsearch 6.7 or later. To use SAML authentication, fine-grained access control must be enabled.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  enforceHttps: true,
  nodeToNodeEncryption: true,
  encryptionAtRest: {
    enabled: true,
  },
  fineGrainedAccessControl: {
    masterUserName: 'master-user',
    samlAuthenticationEnabled: true,
    samlAuthenticationOptions: {
      idpEntityId: 'entity-id',
      idpMetadataContent: 'metadata-content-with-quotes-escaped',
    },
  },
});
python
from aws_cdk.aws_opensearchservice import EncryptionAtRestOptions, AdvancedSecurityOptions, SAMLOptionsProperty
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    enforce_https=True,
    node_to_node_encryption=True,
    encryption_at_rest=EncryptionAtRestOptions(
        enabled=True
    ),
    fine_grained_access_control=AdvancedSecurityOptions(
        master_user_name="master-user",
        saml_authentication_enabled=True,
        saml_authentication_options=SAMLOptionsProperty(
            idp_entity_id="entity-id",
            idp_metadata_content="metadata-content-with-quotes-escaped"
        )
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .enforceHttps(true)
        .nodeToNodeEncryption(true)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .fineGrainedAccessControl(AdvancedSecurityOptions.builder()
                .masterUserName("master-user")
                .samlAuthenticationEnabled(true)
                .samlAuthenticationOptions(SAMLOptionsProperty.builder()
                        .idpEntityId("entity-id")
                        .idpMetadataContent("metadata-content-with-quotes-escaped")
                        .build())
                .build())
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    EnforceHttps = true,
    NodeToNodeEncryption = true,
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    },
    FineGrainedAccessControl = new AdvancedSecurityOptions {
        MasterUserName = "master-user",
        SamlAuthenticationEnabled = true,
        SamlAuthenticationOptions = new SAMLOptionsProperty {
            IdpEntityId = "entity-id",
            IdpMetadataContent = "metadata-content-with-quotes-escaped"
        }
    }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	EnforceHttps: jsii.Boolean(true),
	NodeToNodeEncryption: jsii.Boolean(true),
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
	FineGrainedAccessControl: &AdvancedSecurityOptions{
		MasterUserName: jsii.String("master-user"),
		SamlAuthenticationEnabled: jsii.Boolean(true),
		SamlAuthenticationOptions: &SAMLOptionsProperty{
			IdpEntityId: jsii.String("entity-id"),
			IdpMetadataContent: jsii.String("metadata-content-with-quotes-escaped"),
		},
	},
})

Using unsigned basic auth ​

For convenience, the domain can be configured to allow unsigned HTTP requests that use basic auth. Unless the domain is configured to be part of a VPC this means anyone can access the domain using the configured master username and password.

To enable unsigned basic auth access the domain is configured with an access policy that allows anonymous requests, HTTPS required, node to node encryption, encryption at rest and fine grained access control.

If the above settings are not set they will be configured as part of enabling unsigned basic auth. If they are set with conflicting values, an error will be thrown.

If no master user is configured a default master user is created with the username admin.

If no password is configured a default master user password is created and stored in the AWS Secrets Manager as secret. The secret has the prefix <domain id>MasterUser.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  useUnsignedBasicAuth: true,
});

const masterUserPassword = domain.masterUserPassword;
python
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    use_unsigned_basic_auth=True
)

master_user_password = domain.master_user_password
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .useUnsignedBasicAuth(true)
        .build();

SecretValue masterUserPassword = domain.getMasterUserPassword();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    UseUnsignedBasicAuth = true
});

var masterUserPassword = domain.MasterUserPassword;
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	UseUnsignedBasicAuth: jsii.Boolean(true),
})

masterUserPassword := domain.MasterUserPassword

Custom access policies ​

If the domain requires custom access control it can be configured either as a constructor property, or later by means of a helper method.

For simple permissions the accessPolicies constructor may be sufficient:

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  accessPolicies: [
    new iam.PolicyStatement({
      actions: ['es:*ESHttpPost', 'es:ESHttpPut*'],
      effect: iam.Effect.ALLOW,
      principals: [new iam.AccountPrincipal('123456789012')],
      resources: ['*'],
    }),
  ]
});
python
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    access_policies=[
        iam.PolicyStatement(
            actions=["es:*ESHttpPost", "es:ESHttpPut*"],
            effect=iam.Effect.ALLOW,
            principals=[iam.AccountPrincipal("123456789012")],
            resources=["*"]
        )
    ]
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .accessPolicies(List.of(
            PolicyStatement.Builder.create()
                    .actions(List.of("es:*ESHttpPost", "es:ESHttpPut*"))
                    .effect(Effect.ALLOW)
                    .principals(List.of(new AccountPrincipal("123456789012")))
                    .resources(List.of("*"))
                    .build()))
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    AccessPolicies = new [] {
        new PolicyStatement(new PolicyStatementProps {
            Actions = new [] { "es:*ESHttpPost", "es:ESHttpPut*" },
            Effect = Effect.ALLOW,
            Principals = new [] { new AccountPrincipal("123456789012") },
            Resources = new [] { "*" }
        }) }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	AccessPolicies: []PolicyStatement{
		iam.NewPolicyStatement(&PolicyStatementProps{
			Actions: []*string{
				jsii.String("es:*ESHttpPost"),
				jsii.String("es:ESHttpPut*"),
			},
			Effect: iam.Effect_ALLOW,
			Principals: []IPrincipal{
				iam.NewAccountPrincipal(jsii.String("123456789012")),
			},
			Resources: []*string{
				jsii.String("*"),
			},
		}),
	},
})

For more complex use-cases, for example, to set the domain up to receive data from a cross-account Amazon Data Firehose the addAccessPolicies helper method allows for policies that include the explicit domain ARN.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
});
domain.addAccessPolicies(
  new iam.PolicyStatement({
    actions: ['es:ESHttpPost', 'es:ESHttpPut'],
    effect: iam.Effect.ALLOW,
    principals: [new iam.AccountPrincipal('123456789012')],
    resources: [domain.domainArn, `${domain.domainArn}/*`],
  }),
  new iam.PolicyStatement({
    actions: ['es:ESHttpGet'],
    effect: iam.Effect.ALLOW,
    principals: [new iam.AccountPrincipal('123456789012')],
    resources: [
      `${domain.domainArn}/_all/_settings`,
      `${domain.domainArn}/_cluster/stats`,
      `${domain.domainArn}/index-name*/_mapping/type-name`,
      `${domain.domainArn}/roletest*/_mapping/roletest`,
      `${domain.domainArn}/_nodes`,
      `${domain.domainArn}/_nodes/stats`,
      `${domain.domainArn}/_nodes/*/stats`,
      `${domain.domainArn}/_stats`,
      `${domain.domainArn}/index-name*/_stats`,
      `${domain.domainArn}/roletest*/_stat`,
    ],
  }),
);
python
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0
)
domain.add_access_policies(
    iam.PolicyStatement(
        actions=["es:ESHttpPost", "es:ESHttpPut"],
        effect=iam.Effect.ALLOW,
        principals=[iam.AccountPrincipal("123456789012")],
        resources=[domain.domain_arn, f"{domain.domainArn}/*"]
    ),
    iam.PolicyStatement(
        actions=["es:ESHttpGet"],
        effect=iam.Effect.ALLOW,
        principals=[iam.AccountPrincipal("123456789012")],
        resources=[f"{domain.domainArn}/_all/_settings", f"{domain.domainArn}/_cluster/stats", f"{domain.domainArn}/index-name*/_mapping/type-name", f"{domain.domainArn}/roletest*/_mapping/roletest", f"{domain.domainArn}/_nodes", f"{domain.domainArn}/_nodes/stats", f"{domain.domainArn}/_nodes/*/stats", f"{domain.domainArn}/_stats", f"{domain.domainArn}/index-name*/_stats", f"{domain.domainArn}/roletest*/_stat"
        ]
    ))
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .build();
domain.addAccessPolicies(
PolicyStatement.Builder.create()
        .actions(List.of("es:ESHttpPost", "es:ESHttpPut"))
        .effect(Effect.ALLOW)
        .principals(List.of(new AccountPrincipal("123456789012")))
        .resources(List.of(domain.getDomainArn(), String.format("%s/*", domain.getDomainArn())))
        .build(),
PolicyStatement.Builder.create()
        .actions(List.of("es:ESHttpGet"))
        .effect(Effect.ALLOW)
        .principals(List.of(new AccountPrincipal("123456789012")))
        .resources(List.of(String.format("%s/_all/_settings", domain.getDomainArn()), String.format("%s/_cluster/stats", domain.getDomainArn()), String.format("%s/index-name*/_mapping/type-name", domain.getDomainArn()), String.format("%s/roletest*/_mapping/roletest", domain.getDomainArn()), String.format("%s/_nodes", domain.getDomainArn()), String.format("%s/_nodes/stats", domain.getDomainArn()), String.format("%s/_nodes/*/stats", domain.getDomainArn()), String.format("%s/_stats", domain.getDomainArn()), String.format("%s/index-name*/_stats", domain.getDomainArn()), String.format("%s/roletest*/_stat", domain.getDomainArn())))
        .build());
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0
});
domain.AddAccessPolicies(
new PolicyStatement(new PolicyStatementProps {
    Actions = new [] { "es:ESHttpPost", "es:ESHttpPut" },
    Effect = Effect.ALLOW,
    Principals = new [] { new AccountPrincipal("123456789012") },
    Resources = new [] { domain.DomainArn, $"{domain.domainArn}/*" }
}),
new PolicyStatement(new PolicyStatementProps {
    Actions = new [] { "es:ESHttpGet" },
    Effect = Effect.ALLOW,
    Principals = new [] { new AccountPrincipal("123456789012") },
    Resources = new [] { $"{domain.domainArn}/_all/_settings", $"{domain.domainArn}/_cluster/stats", $"{domain.domainArn}/index-name*/_mapping/type-name", $"{domain.domainArn}/roletest*/_mapping/roletest", $"{domain.domainArn}/_nodes", $"{domain.domainArn}/_nodes/stats", $"{domain.domainArn}/_nodes/*/stats", $"{domain.domainArn}/_stats", $"{domain.domainArn}/index-name*/_stats", $"{domain.domainArn}/roletest*/_stat" }
}));
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
})
domain.AddAccessPolicies(
iam.NewPolicyStatement(&PolicyStatementProps{
	Actions: []*string{
		jsii.String("es:ESHttpPost"),
		jsii.String("es:ESHttpPut"),
	},
	Effect: iam.Effect_ALLOW,
	Principals: []IPrincipal{
		iam.NewAccountPrincipal(jsii.String("123456789012")),
	},
	Resources: []*string{
		domain.domainArn,
		fmt.Sprintf("%v/*", domain.domainArn),
	},
}),
iam.NewPolicyStatement(&PolicyStatementProps{
	Actions: []*string{
		jsii.String("es:ESHttpGet"),
	},
	Effect: iam.Effect_ALLOW,
	Principals: []IPrincipal{
		iam.NewAccountPrincipal(jsii.String("123456789012")),
	},
	Resources: []*string{
		fmt.Sprintf("%v/_all/_settings", domain.domainArn),
		fmt.Sprintf("%v/_cluster/stats", domain.domainArn),
		fmt.Sprintf("%v/index-name*/_mapping/type-name", domain.domainArn),
		fmt.Sprintf("%v/roletest*/_mapping/roletest", domain.domainArn),
		fmt.Sprintf("%v/_nodes", domain.domainArn),
		fmt.Sprintf("%v/_nodes/stats", domain.domainArn),
		fmt.Sprintf("%v/_nodes/*/stats", domain.domainArn),
		fmt.Sprintf("%v/_stats", domain.domainArn),
		fmt.Sprintf("%v/index-name*/_stats", domain.domainArn),
		fmt.Sprintf("%v/roletest*/_stat", domain.domainArn),
	},
}))

Audit logs ​

Audit logs can be enabled for a domain, but only when fine grained access control is enabled.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  enforceHttps: true,
  nodeToNodeEncryption: true,
  encryptionAtRest: {
    enabled: true,
  },
  fineGrainedAccessControl: {
    masterUserName: 'master-user',
  },
  logging: {
    auditLogEnabled: true,
    slowSearchLogEnabled: true,
    appLogEnabled: true,
    slowIndexLogEnabled: true,
  },
});
python
from aws_cdk.aws_opensearchservice import EncryptionAtRestOptions, AdvancedSecurityOptions, LoggingOptions
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    enforce_https=True,
    node_to_node_encryption=True,
    encryption_at_rest=EncryptionAtRestOptions(
        enabled=True
    ),
    fine_grained_access_control=AdvancedSecurityOptions(
        master_user_name="master-user"
    ),
    logging=LoggingOptions(
        audit_log_enabled=True,
        slow_search_log_enabled=True,
        app_log_enabled=True,
        slow_index_log_enabled=True
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .enforceHttps(true)
        .nodeToNodeEncryption(true)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .fineGrainedAccessControl(AdvancedSecurityOptions.builder()
                .masterUserName("master-user")
                .build())
        .logging(LoggingOptions.builder()
                .auditLogEnabled(true)
                .slowSearchLogEnabled(true)
                .appLogEnabled(true)
                .slowIndexLogEnabled(true)
                .build())
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    EnforceHttps = true,
    NodeToNodeEncryption = true,
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    },
    FineGrainedAccessControl = new AdvancedSecurityOptions {
        MasterUserName = "master-user"
    },
    Logging = new LoggingOptions {
        AuditLogEnabled = true,
        SlowSearchLogEnabled = true,
        AppLogEnabled = true,
        SlowIndexLogEnabled = true
    }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	EnforceHttps: jsii.Boolean(true),
	NodeToNodeEncryption: jsii.Boolean(true),
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
	FineGrainedAccessControl: &AdvancedSecurityOptions{
		MasterUserName: jsii.String("master-user"),
	},
	Logging: &LoggingOptions{
		AuditLogEnabled: jsii.Boolean(true),
		SlowSearchLogEnabled: jsii.Boolean(true),
		AppLogEnabled: jsii.Boolean(true),
		SlowIndexLogEnabled: jsii.Boolean(true),
	},
})

Suppress creating CloudWatch Logs resource policy ​

When logging is enabled for the domain, the CloudWatch Logs resource policy is created by default. This resource policy is necessary for logging, but since only a maximum of 10 resource policies can be created per region, the maximum number of resource policies may be a problem when enabling logging for several domains. By setting the suppressLogsResourcePolicy option to true, you can suppress the creation of a CloudWatch Logs resource policy.

If you set the suppressLogsResourcePolicy option to true, you must create a resource policy before deployment. Also, to avoid reaching this limit, consider reusing a broader policy that includes multiple log groups.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  enforceHttps: true,
  nodeToNodeEncryption: true,
  encryptionAtRest: {
    enabled: true,
  },
  fineGrainedAccessControl: {
    masterUserName: 'master-user',
  },
  logging: {
    auditLogEnabled: true,
    slowSearchLogEnabled: true,
    appLogEnabled: true,
    slowIndexLogEnabled: true,
  },
  suppressLogsResourcePolicy: true,
});
python
from aws_cdk.aws_opensearchservice import EncryptionAtRestOptions, AdvancedSecurityOptions, LoggingOptions
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    enforce_https=True,
    node_to_node_encryption=True,
    encryption_at_rest=EncryptionAtRestOptions(
        enabled=True
    ),
    fine_grained_access_control=AdvancedSecurityOptions(
        master_user_name="master-user"
    ),
    logging=LoggingOptions(
        audit_log_enabled=True,
        slow_search_log_enabled=True,
        app_log_enabled=True,
        slow_index_log_enabled=True
    ),
    suppress_logs_resource_policy=True
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .enforceHttps(true)
        .nodeToNodeEncryption(true)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .fineGrainedAccessControl(AdvancedSecurityOptions.builder()
                .masterUserName("master-user")
                .build())
        .logging(LoggingOptions.builder()
                .auditLogEnabled(true)
                .slowSearchLogEnabled(true)
                .appLogEnabled(true)
                .slowIndexLogEnabled(true)
                .build())
        .suppressLogsResourcePolicy(true)
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    EnforceHttps = true,
    NodeToNodeEncryption = true,
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    },
    FineGrainedAccessControl = new AdvancedSecurityOptions {
        MasterUserName = "master-user"
    },
    Logging = new LoggingOptions {
        AuditLogEnabled = true,
        SlowSearchLogEnabled = true,
        AppLogEnabled = true,
        SlowIndexLogEnabled = true
    },
    SuppressLogsResourcePolicy = true
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	EnforceHttps: jsii.Boolean(true),
	NodeToNodeEncryption: jsii.Boolean(true),
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
	FineGrainedAccessControl: &AdvancedSecurityOptions{
		MasterUserName: jsii.String("master-user"),
	},
	Logging: &LoggingOptions{
		AuditLogEnabled: jsii.Boolean(true),
		SlowSearchLogEnabled: jsii.Boolean(true),
		AppLogEnabled: jsii.Boolean(true),
		SlowIndexLogEnabled: jsii.Boolean(true),
	},
	SuppressLogsResourcePolicy: jsii.Boolean(true),
})

Visit Monitoring OpenSearch logs with Amazon CloudWatch Logs for more details.

UltraWarm ​

UltraWarm nodes can be enabled to provide a cost-effective way to store large amounts of read-only data.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  capacity: {
    masterNodes: 2,
    warmNodes: 2,
    warmInstanceType: 'ultrawarm1.medium.search',
  },
});
python
from aws_cdk.aws_opensearchservice import CapacityConfig
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    capacity=CapacityConfig(
        master_nodes=2,
        warm_nodes=2,
        warm_instance_type="ultrawarm1.medium.search"
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .capacity(CapacityConfig.builder()
                .masterNodes(2)
                .warmNodes(2)
                .warmInstanceType("ultrawarm1.medium.search")
                .build())
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    Capacity = new CapacityConfig {
        MasterNodes = 2,
        WarmNodes = 2,
        WarmInstanceType = "ultrawarm1.medium.search"
    }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	Capacity: &CapacityConfig{
		MasterNodes: jsii.Number(2),
		WarmNodes: jsii.Number(2),
		WarmInstanceType: jsii.String("ultrawarm1.medium.search"),
	},
})

Cold storage ​

Cold storage can be enabled on the domain. You must enable UltraWarm storage to enable cold storage.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  capacity: {
    masterNodes: 2,
    warmNodes: 2,
    warmInstanceType: 'ultrawarm1.medium.search',
  },
  coldStorageEnabled: true,
});
python
from aws_cdk.aws_opensearchservice import CapacityConfig
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    capacity=CapacityConfig(
        master_nodes=2,
        warm_nodes=2,
        warm_instance_type="ultrawarm1.medium.search"
    ),
    cold_storage_enabled=True
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .capacity(CapacityConfig.builder()
                .masterNodes(2)
                .warmNodes(2)
                .warmInstanceType("ultrawarm1.medium.search")
                .build())
        .coldStorageEnabled(true)
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    Capacity = new CapacityConfig {
        MasterNodes = 2,
        WarmNodes = 2,
        WarmInstanceType = "ultrawarm1.medium.search"
    },
    ColdStorageEnabled = true
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	Capacity: &CapacityConfig{
		MasterNodes: jsii.Number(2),
		WarmNodes: jsii.Number(2),
		WarmInstanceType: jsii.String("ultrawarm1.medium.search"),
	},
	ColdStorageEnabled: jsii.Boolean(true),
})

S3 Vectors Engine ​

Amazon OpenSearch Service offers the ability to use Amazon S3 as a vector engine for vector indexes. This feature allows you to offload vector data to Amazon S3 while maintaining sub-second vector search capabilities at low cost.

Requirements:

  • OpenSearch version 2.19 or later
  • OpenSearch Optimized instance types (OR1, OR2, OM2, OI2) for data nodes
  • Encryption at rest must be enabled
ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_2_19,
  s3VectorsEngineEnabled: true,
  capacity: {
    dataNodeInstanceType: 'or1.medium.search',
  },
  encryptionAtRest: {
    enabled: true,
  },
});
python
from aws_cdk.aws_opensearchservice import CapacityConfig, EncryptionAtRestOptions
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_2_19,
    s3_vectors_engine_enabled=True,
    capacity=CapacityConfig(
        data_node_instance_type="or1.medium.search"
    ),
    encryption_at_rest=EncryptionAtRestOptions(
        enabled=True
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_2_19)
        .s3VectorsEngineEnabled(true)
        .capacity(CapacityConfig.builder()
                .dataNodeInstanceType("or1.medium.search")
                .build())
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_2_19,
    S3VectorsEngineEnabled = true,
    Capacity = new CapacityConfig {
        DataNodeInstanceType = "or1.medium.search"
    },
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_2_19(),
	S3VectorsEngineEnabled: jsii.Boolean(true),
	Capacity: &CapacityConfig{
		DataNodeInstanceType: jsii.String("or1.medium.search"),
	},
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
})

Custom endpoint ​

Custom endpoints can be configured to reach the domain under a custom domain name.

ts
new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  customEndpoint: {
    domainName: 'search.example.com',
  },
});
python
from aws_cdk.aws_opensearchservice import CustomEndpointOptions
Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    custom_endpoint=CustomEndpointOptions(
        domain_name="search.example.com"
    )
)
java
Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .customEndpoint(CustomEndpointOptions.builder()
                .domainName("search.example.com")
                .build())
        .build();
csharp
new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    CustomEndpoint = new CustomEndpointOptions {
        DomainName = "search.example.com"
    }
});
go
awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	CustomEndpoint: &CustomEndpointOptions{
		DomainName: jsii.String("search.example.com"),
	},
})

It is also possible to specify a custom certificate instead of the auto-generated one.

Additionally, an automatic CNAME-Record is created if a hosted zone is provided for the custom endpoint

Advanced options ​

Advanced options can used to configure additional options.

ts
new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  advancedOptions: {
    'rest.action.multi.allow_explicit_index': 'false',
    'indices.fielddata.cache.size': '25',
    'indices.query.bool.max_clause_count': '2048',
  },
});
python
Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    advanced_options={
        "rest.action.multi.allow_explicit_index": "false",
        "indices.fielddata.cache.size": "25",
        "indices.query.bool.max_clause_count": "2048"
    }
)
java
Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .advancedOptions(Map.of(
                "rest.action.multi.allow_explicit_index", "false",
                "indices.fielddata.cache.size", "25",
                "indices.query.bool.max_clause_count", "2048"))
        .build();
csharp
new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    AdvancedOptions = new Dictionary<string, string> {
        { "rest.action.multi.allow_explicit_index", "false" },
        { "indices.fielddata.cache.size", "25" },
        { "indices.query.bool.max_clause_count", "2048" }
    }
});
go
awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	AdvancedOptions: map[string]*string{
		"rest.action.multi.allow_explicit_index": jsii.String("false"),
		"indices.fielddata.cache.size": jsii.String("25"),
		"indices.query.bool.max_clause_count": jsii.String("2048"),
	},
})

Amazon Cognito authentication for OpenSearch Dashboards ​

The domain can be configured to use Amazon Cognito authentication for OpenSearch Dashboards.

Visit Configuring Amazon Cognito authentication for OpenSearch Dashboards for more details.

ts
declare const cognitoConfigurationRole: iam.Role;

const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  cognitoDashboardsAuth: {
    role: cognitoConfigurationRole,
    identityPoolId: 'example-identity-pool-id',
    userPoolId: 'example-user-pool-id',
  },
});
python
from aws_cdk.aws_opensearchservice import CognitoOptions
# cognito_configuration_role: iam.Role


domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    cognito_dashboards_auth=CognitoOptions(
        role=cognito_configuration_role,
        identity_pool_id="example-identity-pool-id",
        user_pool_id="example-user-pool-id"
    )
)
java
Role cognitoConfigurationRole;


Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .cognitoDashboardsAuth(CognitoOptions.builder()
                .role(cognitoConfigurationRole)
                .identityPoolId("example-identity-pool-id")
                .userPoolId("example-user-pool-id")
                .build())
        .build();
csharp
Role cognitoConfigurationRole;


var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    CognitoDashboardsAuth = new CognitoOptions {
        Role = cognitoConfigurationRole,
        IdentityPoolId = "example-identity-pool-id",
        UserPoolId = "example-user-pool-id"
    }
});
go
var cognitoConfigurationRole Role


domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	CognitoDashboardsAuth: &CognitoOptions{
		Role: cognitoConfigurationRole,
		IdentityPoolId: jsii.String("example-identity-pool-id"),
		UserPoolId: jsii.String("example-user-pool-id"),
	},
})

Enable support for Multi-AZ with Standby deployment ​

The domain can be configured to use multi-AZ with standby.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_3,
  ebs: {
    volumeSize: 10,
    volumeType: ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3,
  },
  zoneAwareness: {
    enabled: true,
    availabilityZoneCount: 3,
  },
  capacity: {
    multiAzWithStandbyEnabled: true,
    masterNodes: 3,
    dataNodes: 3,
  },
});
python
from aws_cdk.aws_opensearchservice import EbsOptions, ZoneAwarenessConfig, CapacityConfig
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_3,
    ebs=EbsOptions(
        volume_size=10,
        volume_type=ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3
    ),
    zone_awareness=ZoneAwarenessConfig(
        enabled=True,
        availability_zone_count=3
    ),
    capacity=CapacityConfig(
        multi_az_with_standby_enabled=True,
        master_nodes=3,
        data_nodes=3
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_3)
        .ebs(EbsOptions.builder()
                .volumeSize(10)
                .volumeType(EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3)
                .build())
        .zoneAwareness(ZoneAwarenessConfig.builder()
                .enabled(true)
                .availabilityZoneCount(3)
                .build())
        .capacity(CapacityConfig.builder()
                .multiAzWithStandbyEnabled(true)
                .masterNodes(3)
                .dataNodes(3)
                .build())
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_3,
    Ebs = new EbsOptions {
        VolumeSize = 10,
        VolumeType = EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3
    },
    ZoneAwareness = new ZoneAwarenessConfig {
        Enabled = true,
        AvailabilityZoneCount = 3
    },
    Capacity = new CapacityConfig {
        MultiAzWithStandbyEnabled = true,
        MasterNodes = 3,
        DataNodes = 3
    }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_3(),
	Ebs: &EbsOptions{
		VolumeSize: jsii.Number(10),
		VolumeType: ec2.EbsDeviceVolumeType_GENERAL_PURPOSE_SSD_GP3,
	},
	ZoneAwareness: &ZoneAwarenessConfig{
		Enabled: jsii.Boolean(true),
		AvailabilityZoneCount: jsii.Number(3),
	},
	Capacity: &CapacityConfig{
		MultiAzWithStandbyEnabled: jsii.Boolean(true),
		MasterNodes: jsii.Number(3),
		DataNodes: jsii.Number(3),
	},
})

Define off-peak windows ​

The domain can be configured to use a daily 10-hour window considered as off-peak hours.

Off-peak windows were introduced on February 16, 2023. All domains created before this date have the off-peak window disabled by default. You must manually enable and configure the off-peak window for these domains. All domains created after this date will have the off-peak window enabled by default. You can't disable the off-peak window for a domain after it's enabled.

Visit Defining off-peak windows for Amazon OpenSearch Service for more details.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_3,
  offPeakWindowEnabled: true, // can be omitted if offPeakWindowStart is set
  offPeakWindowStart: {
    hours: 20,
    minutes: 0,
  },
});
python
from aws_cdk.aws_opensearchservice import WindowStartTime
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_3,
    off_peak_window_enabled=True,  # can be omitted if offPeakWindowStart is set
    off_peak_window_start=WindowStartTime(
        hours=20,
        minutes=0
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_3)
        .offPeakWindowEnabled(true) // can be omitted if offPeakWindowStart is set
        .offPeakWindowStart(WindowStartTime.builder()
                .hours(20)
                .minutes(0)
                .build())
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_3,
    OffPeakWindowEnabled = true,  // can be omitted if offPeakWindowStart is set
    OffPeakWindowStart = new WindowStartTime {
        Hours = 20,
        Minutes = 0
    }
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_3(),
	OffPeakWindowEnabled: jsii.Boolean(true),
	 // can be omitted if offPeakWindowStart is set
	OffPeakWindowStart: &WindowStartTime{
		Hours: jsii.Number(20),
		Minutes: jsii.Number(0),
	},
})

Configuring service software updates ​

The domain can be configured to use service software updates.

Visit Service software updates in Amazon OpenSearch Service for more details.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_3,
  enableAutoSoftwareUpdate: true,
  useLatestServiceSoftwareForBlueGreen: true,
});
python
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_3,
    enable_auto_software_update=True,
    use_latest_service_software_for_blue_green=True
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_3)
        .enableAutoSoftwareUpdate(true)
        .useLatestServiceSoftwareForBlueGreen(true)
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_3,
    EnableAutoSoftwareUpdate = true,
    UseLatestServiceSoftwareForBlueGreen = true
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_3(),
	EnableAutoSoftwareUpdate: jsii.Boolean(true),
	UseLatestServiceSoftwareForBlueGreen: jsii.Boolean(true),
})

IP address type ​

You can specify either dual stack or IPv4 as your IP address type.

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_3,
  ipAddressType: IpAddressType.DUAL_STACK,
});
python
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_3,
    ip_address_type=IpAddressType.DUAL_STACK
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_3)
        .ipAddressType(IpAddressType.DUAL_STACK)
        .build();
csharp
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_3,
    IpAddressType = IpAddressType.DUAL_STACK
});
go
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_3(),
	IpAddressType: awscdk.IpAddressType_DUAL_STACK,
})

Using Coordinator node with NodeOptions ​

You can specify coordinator as a valid value for node type.

Visit Dedicated coordinator nodes in Amazon OpenSearch Service for more details.

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',
        },
      },
    ],
  },
})
python
import aws_cdk.aws_opensearchservice as opensearch


domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_3,
    capacity=opensearch.CapacityConfig(
        node_options=[opensearch.NodeOptions(
            node_type=opensearch.NodeType.COORDINATOR,
            node_config=opensearch.NodeConfig(
                enabled=True,
                count=2,
                type="m5.large.search"
            )
        )
        ]
    )
)
java
import software.amazon.awscdk.services.opensearchservice.*;


Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_3)
        .capacity(CapacityConfig.builder()
                .nodeOptions(List.of(NodeOptions.builder()
                        .nodeType(NodeType.COORDINATOR)
                        .nodeConfig(NodeConfig.builder()
                                .enabled(true)
                                .count(2)
                                .type("m5.large.search")
                                .build())
                        .build()))
                .build())
        .build();
csharp
using Amazon.CDK.AWS.OpenSearchService;


var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_3,
    Capacity = new CapacityConfig {
        NodeOptions = new [] { new NodeOptions {
            NodeType = NodeType.COORDINATOR,
            NodeConfig = new NodeConfig {
                Enabled = true,
                Count = 2,
                Type = "m5.large.search"
            }
        } }
    }
});
go
import opensearch "github.com/aws/aws-cdk-go/awscdk"


domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_3(),
	Capacity: &CapacityConfig{
		NodeOptions: []NodeOptions{
			&NodeOptions{
				NodeType: opensearch.NodeType_COORDINATOR,
				NodeConfig: &NodeConfig{
					Enabled: jsii.Boolean(true),
					Count: jsii.Number(2),
					Type: jsii.String("m5.large.search"),
				},
			},
		},
	},
})

Types ​

NameKindSummary
DomainConstruct (L2)Provides an Amazon OpenSearch Service domain.
CfnApplicationConstruct (L1)Creates an OpenSearch UI application.
CfnDomainConstruct (L1)The AWS::OpenSearchService::Domain resource creates an Amazon OpenSearch Service domain.
AdvancedSecurityOptionsStructSpecifies options for fine-grained access control.
CapacityConfigStructConfigures the capacity of the cluster such as the instance type and the number of instances.
CfnApplication.AppConfigPropertyStructConfiguration settings for an OpenSearch application.
CfnApplication.DataSourcePropertyStructData sources that are associated with an OpenSearch application.
CfnApplication.IamIdentityCenterOptionsPropertyStructConfiguration settings for IAM Identity Center in an OpenSearch application.
CfnApplicationPropsStructProperties for defining a CfnApplication.
CfnDomain.AdvancedSecurityOptionsInputPropertyStructSpecifies options for fine-grained access control.
CfnDomain.AIMLOptionsPropertyStruct
CfnDomain.AutomatedSnapshotPauseOptionsPropertyStruct
CfnDomain.ClusterConfigPropertyStructThe cluster configuration for the OpenSearch Service domain.
CfnDomain.CognitoOptionsPropertyStructConfigures OpenSearch Service to use Amazon Cognito authentication for OpenSearch Dashboards.
CfnDomain.ColdStorageOptionsPropertyStructContainer for the parameters required to enable cold storage for an OpenSearch Service domain.
CfnDomain.DeploymentStrategyOptionsPropertyStruct
CfnDomain.DomainEndpointOptionsPropertyStructSpecifies 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.
CfnDomain.EBSOptionsPropertyStructThe configurations of Amazon Elastic Block Store (Amazon EBS) volumes that are attached to data nodes in the OpenSearch Service domain.
CfnDomain.EncryptionAtRestOptionsPropertyStructWhether the domain should encrypt data at rest, and if so, the AWS Key Management Service key to use.
CfnDomain.IAMFederationOptionsPropertyStruct
CfnDomain.IdentityCenterOptionsPropertyStructSettings container for integrating IAM Identity Center with OpenSearch UI applications, which enables enabling secure user authentication and access control across multiple data sources.
CfnDomain.IdpPropertyStructThe SAML Identity Provider's information.
CfnDomain.JWTOptionsPropertyStruct
CfnDomain.LogPublishingOptionPropertyStructSpecifies whether the OpenSearch Service domain publishes application, search slow logs, or index slow logs to Amazon CloudWatch.
CfnDomain.MasterUserOptionsPropertyStructSpecifies information about the master user.
CfnDomain.NodeConfigPropertyStructConfiguration options for defining the setup of any node type within the cluster.
CfnDomain.NodeOptionPropertyStructConfiguration settings for defining the node type within a cluster.
CfnDomain.NodeToNodeEncryptionOptionsPropertyStructSpecifies options for node-to-node encryption.
CfnDomain.OffPeakWindowOptionsPropertyStructOff-peak window settings for the domain.
CfnDomain.OffPeakWindowPropertyStructA custom 10-hour, low-traffic window during which OpenSearch Service can perform mandatory configuration changes on the domain.
CfnDomain.S3VectorsEnginePropertyStructOptions for enabling S3 vectors engine features on the specified domain.
CfnDomain.SAMLOptionsPropertyStructContainer for information about the SAML configuration for OpenSearch Dashboards.
CfnDomain.ServerlessVectorAccelerationPropertyStruct
CfnDomain.ServiceSoftwareOptionsPropertyStructThe current status of the service software for an Amazon OpenSearch Service domain.
CfnDomain.SnapshotOptionsPropertyStructDEPRECATED .
CfnDomain.SoftwareUpdateOptionsPropertyStructOptions for configuring service software updates for a domain.
CfnDomain.VPCOptionsPropertyStructThe virtual private cloud (VPC) configuration for the OpenSearch Service domain.
CfnDomain.WindowStartTimePropertyStructA custom start time for the off-peak window, in Coordinated Universal Time (UTC).
CfnDomain.ZoneAwarenessConfigPropertyStructSpecifies zone awareness configuration options.
CfnDomainPropsStructProperties for defining a CfnDomain.
CognitoOptionsStructConfigures Amazon OpenSearch Service to use Amazon Cognito authentication for OpenSearch Dashboards.
CustomEndpointOptionsStructConfigures a custom domain endpoint for the Amazon OpenSearch Service domain.
DomainAttributesStructReference to an Amazon OpenSearch Service domain.
DomainGrantsFacadeCollection of grant methods for a IDomainRef.
DomainPropsStructProperties for an Amazon OpenSearch Service domain.
EbsOptionsStructThe configurations of Amazon Elastic Block Store (Amazon EBS) volumes that are attached to data nodes in the Amazon OpenSearch Service domain.
EncryptionAtRestOptionsStructWhether the domain should encrypt data at rest, and if so, the AWS Key Management Service (KMS) key to use.
EngineVersionClassOpenSearch version.
IDomainInterfaceAn interface that represents an Amazon OpenSearch Service domain - either created with the CDK, or an existing one.
IpAddressTypeEnumThe IP address type for the domain.
LoggingOptionsStructConfigures log settings for the domain.
NodeConfigStructConfiguration for a specific node type in OpenSearch domain.
NodeOptionsStructConfiguration for node options in OpenSearch domain.
NodeTypeEnumNodeType is a string enum of the node types in OpenSearch domain.
SAMLOptionsPropertyStructContainer for information about the SAML configuration for OpenSearch Dashboards.
TLSSecurityPolicyEnumThe minimum TLS version required for traffic to the domain.
WindowStartTimeStruct
ZoneAwarenessConfigStructSpecifies zone awareness configuration options.