Skip to content
v2.274.0

DomainProps Struct ​

Properties for an Amazon OpenSearch Service domain.

Example ​

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,
  },
});

Properties ​

accessPoliciesoptionalPolicyStatement[]access_policiesoptionaltyping.List[PolicyStatement]accessPoliciesoptionalList<PolicyStatement>AccessPoliciesoptionalPolicyStatement[]AccessPoliciesoptional*[]PolicyStatement#
Domain access policies.

Default: No access policies.

advancedOptionsoptional{ [key: string]: string }advanced_optionsoptionaltyping.Mapping[str, str]advancedOptionsoptionalMap<String, String>AdvancedOptionsoptionalIDictionary<string, string>AdvancedOptionsoptional*map[string]*string#
Additional options to specify for the Amazon OpenSearch Service domain.

Default: no advanced options are specified

automatedSnapshotStartHouroptionalnumberautomated_snapshot_start_houroptionalint | floatautomatedSnapshotStartHouroptionalNumberAutomatedSnapshotStartHouroptionaldoubleAutomatedSnapshotStartHouroptional*float64#
The hour in UTC during which the service takes an automated daily snapshot of the indices in the Amazon OpenSearch Service domain.

Default: Hourly automated snapshots not used

Only applies for Elasticsearch versions below 5.3.

capacityoptionalCapacityConfigcapacityoptionalCapacityConfigcapacityoptionalCapacityConfigCapacityoptionalCapacityConfigCapacityoptionalCapacityConfig#
The cluster capacity configuration for the Amazon OpenSearch Service domain.

Default: 1 r5.large.search data node; no dedicated master nodes.

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

Default: Cognito not used for authentication to OpenSearch Dashboards.

coldStorageEnabledoptionalbooleancold_storage_enabledoptionalboolcoldStorageEnabledoptionalBooleanColdStorageEnabledoptionalboolColdStorageEnabledoptional*bool= undefined#
Whether to enable or disable cold storage on the domain.

You must enable UltraWarm storage to enable cold storage.

customEndpointoptionalCustomEndpointOptionscustom_endpointoptionalCustomEndpointOptionscustomEndpointoptionalCustomEndpointOptionsCustomEndpointoptionalCustomEndpointOptionsCustomEndpointoptionalCustomEndpointOptions#
To configure a custom domain configure these options.

Default: no custom domain endpoint will be configured

If you specify a Route53 hosted zone it will create a CNAME record and use DNS validation for the certificate

domainNameoptionalstringdomain_nameoptionalstrdomainNameoptionalStringDomainNameoptionalstringDomainNameoptional*string#
Enforces a particular physical domain name.

Default: A name will be auto-generated.

ebsoptionalEbsOptionsebsoptionalEbsOptionsebsoptionalEbsOptionsEbsoptionalEbsOptionsEbsoptionalEbsOptions#
The configurations of Amazon Elastic Block Store (Amazon EBS) volumes that are attached to data nodes in the Amazon OpenSearch Service domain.

Default: 10 GiB General Purpose (SSD) volumes per node.

enableAutoSoftwareUpdateoptionalbooleanenable_auto_software_updateoptionalboolenableAutoSoftwareUpdateoptionalBooleanEnableAutoSoftwareUpdateoptionalboolEnableAutoSoftwareUpdateoptional*bool= false#
Specifies whether automatic service software updates are enabled for the domain.
enableVersionUpgradeoptionalbooleanenable_version_upgradeoptionalboolenableVersionUpgradeoptionalBooleanEnableVersionUpgradeoptionalboolEnableVersionUpgradeoptional*bool= false#
To upgrade an Amazon OpenSearch Service domain to a new version, rather than replacing the entire domain resource, use the EnableVersionUpgrade update policy.
encryptionAtRestoptionalEncryptionAtRestOptionsencryption_at_restoptionalEncryptionAtRestOptionsencryptionAtRestoptionalEncryptionAtRestOptionsEncryptionAtRestoptionalEncryptionAtRestOptionsEncryptionAtRestoptionalEncryptionAtRestOptions#
Encryption at rest options for the cluster.

Default: No encryption at rest

enforceHttpsoptionalbooleanenforce_httpsoptionalboolenforceHttpsoptionalBooleanEnforceHttpsoptionalboolEnforceHttpsoptional*bool= false#
True to require that all traffic to the domain arrive over HTTPS.
fineGrainedAccessControloptionalAdvancedSecurityOptionsfine_grained_access_controloptionalAdvancedSecurityOptionsfineGrainedAccessControloptionalAdvancedSecurityOptionsFineGrainedAccessControloptionalAdvancedSecurityOptionsFineGrainedAccessControloptionalAdvancedSecurityOptions#
Specifies options for fine-grained access control.

Default: fine-grained access control is disabled

Requires Elasticsearch version 6.7 or later or OpenSearch version 1.0 or later. Enabling fine-grained access control also requires encryption of data at rest and node-to-node encryption, along with enforced HTTPS.

ipAddressTypeoptionalIpAddressTypeip_address_typeoptionalIpAddressTypeipAddressTypeoptionalIpAddressTypeIpAddressTypeoptionalIpAddressTypeIpAddressTypeoptionalIpAddressType= IpAddressType.IPV4#
Specify either dual stack or IPv4 as your IP address type.

Dual stack allows you to share domain resources across IPv4 and IPv6 address types, and is the recommended option.

If you set your IP address type to dual stack, you can't change your address type later.

loggingoptionalLoggingOptionsloggingoptionalLoggingOptionsloggingoptionalLoggingOptionsLoggingoptionalLoggingOptionsLoggingoptionalLoggingOptions#
Configuration log publishing configuration options.

Default: No logs are published

nodeToNodeEncryptionoptionalbooleannode_to_node_encryptionoptionalboolnodeToNodeEncryptionoptionalBooleanNodeToNodeEncryptionoptionalboolNodeToNodeEncryptionoptional*bool#
Specify true to enable node to node encryption.

Default: Node to node encryption is not enabled.

Requires Elasticsearch version 6.0 or later or OpenSearch version 1.0 or later.

offPeakWindowEnabledoptionalbooleanoff_peak_window_enabledoptionalbooloffPeakWindowEnabledoptionalBooleanOffPeakWindowEnabledoptionalboolOffPeakWindowEnabledoptional*bool#
Options for enabling a domain's off-peak window, during which OpenSearch Service can perform mandatory configuration changes on the domain.

Default: Disabled for domains created before February 16, 2023. Enabled for domains created after. Enabled if offPeakWindowStart is set.

notes

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.

offPeakWindowStartoptionalWindowStartTimeoff_peak_window_startoptionalWindowStartTimeoffPeakWindowStartoptionalWindowStartTimeOffPeakWindowStartoptionalWindowStartTimeOffPeakWindowStartoptionalWindowStartTime#
Start time for the off-peak window, in Coordinated Universal Time (UTC).

Default: 10:00 P.M. local time

The window length will always be 10 hours, so you can't specify an end time. For example, if you specify 11:00 P.M. UTC as a start time, the end time will automatically be set to 9:00 A.M.

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.RETAIN#
Policy to apply when the domain is removed from the stack.
s3VectorsEngineEnabledoptionalbooleans3_vectors_engine_enabledoptionalbools3VectorsEngineEnabledoptionalBooleanS3VectorsEngineEnabledoptionalboolS3VectorsEngineEnabledoptional*bool#
Whether to enable S3 vectors engine.

Default: undefined - AWS OpenSearch Service default is false

notes

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 (OR*, OM*, OI*) for data nodes
  • Encryption at rest must be enabled
securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup#
The list of security groups that are associated with the VPC endpoints for the domain.

Default: One new security group is created.

Only used if vpc is specified.

suppressLogsResourcePolicyoptionalbooleansuppress_logs_resource_policyoptionalboolsuppressLogsResourcePolicyoptionalBooleanSuppressLogsResourcePolicyoptionalboolSuppressLogsResourcePolicyoptional*bool= false#
Specify whether to create a CloudWatch Logs resource policy or not.
notes

When logging is enabled for the domain, a CloudWatch Logs resource policy is created by default. However, CloudWatch Logs supports only 10 resource policies per region. If you enable logging for several domains, it may hit the quota and cause an error. By setting this property to true, creating a resource policy is suppressed, allowing you to avoid this problem.

If you set this option to true, you must create a resource policy before deployment.

tlsSecurityPolicyoptionalTLSSecurityPolicytls_security_policyoptionalTLSSecurityPolicytlsSecurityPolicyoptionalTLSSecurityPolicyTlsSecurityPolicyoptionalTLSSecurityPolicyTlsSecurityPolicyoptionalTLSSecurityPolicy= TLSSecurityPolicy.TLS_1_2#
The minimum TLS version required for traffic to the domain.
useLatestServiceSoftwareForBlueGreenoptionalbooleanuse_latest_service_software_for_blue_greenoptionalbooluseLatestServiceSoftwareForBlueGreenoptionalBooleanUseLatestServiceSoftwareForBlueGreenoptionalboolUseLatestServiceSoftwareForBlueGreenoptional*bool#
Specifies whether the domain should use the latest service software version during a blue/green deployment.

Default: no value is set and the service default is used

If enabled, the domain will automatically use the latest available service software when a blue/green deployment is triggered.

useUnsignedBasicAuthoptionalbooleanuse_unsigned_basic_authoptionalbooluseUnsignedBasicAuthoptionalBooleanUseUnsignedBasicAuthoptionalboolUseUnsignedBasicAuthoptional*bool= false#
Configures the domain so that unsigned basic auth is enabled.
notes

If no master user is provided a default master user with username admin and a dynamically generated password stored in KMS is created. The password can be retrieved by getting masterUserPassword from the domain instance.

Setting this to true will also add an access policy that allows unsigned access, enable node to node encryption, encryption at rest. If conflicting settings are encountered (like disabling encryption at rest) enabling this setting will cause a failure.

The Elasticsearch/OpenSearch version that your domain will leverage.
vpcoptionalIVpcvpcoptionalIVpcvpcoptionalIVpcVpcoptionalIVpcVpcoptionalIVpc#
Place the domain inside this VPC.

Default: Domain is not placed in a VPC.

vpcSubnetsoptionalSubnetSelection[]vpc_subnetsoptionaltyping.List[SubnetSelection]vpcSubnetsoptionalList<SubnetSelection>VpcSubnetsoptionalSubnetSelection[]VpcSubnetsoptional*[]SubnetSelection#
The specific vpc subnets the domain will be placed in.

Default: All private subnets.

You must provide one subnet for each Availability Zone that your domain uses. For example, you must specify three subnet IDs for a three Availability Zone domain.

Only used if vpc is specified.

zoneAwarenessoptionalZoneAwarenessConfigzone_awarenessoptionalZoneAwarenessConfigzoneAwarenessoptionalZoneAwarenessConfigZoneAwarenessoptionalZoneAwarenessConfigZoneAwarenessoptionalZoneAwarenessConfig#
The cluster zone awareness configuration for the Amazon OpenSearch Service domain.

Default: no zone awareness (1 AZ)