java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.opensearchservice.Domain
All Implemented Interfaces:
IResource, IConnectable, IDomain, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-04-10T22:22:31.066Z") @Stability(Stable) public class Domain extends Resource implements IDomain, IConnectable
Provides an Amazon OpenSearch Service domain.

Example:

 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();
 
  • Constructor Details

    • Domain

      protected Domain(software.amazon.jsii.JsiiObjectRef objRef)
    • Domain

      protected Domain(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Domain

      @Stability(Stable) public Domain(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DomainProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromDomainAttributes

      @Stability(Stable) @NotNull public static IDomain fromDomainAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DomainAttributes attrs)
      Creates a domain construct that represents an external domain.

      Parameters:
      scope - The parent creating construct (usually this). This parameter is required.
      id - The construct's name. This parameter is required.
      attrs - A DomainAttributes object. This parameter is required.
    • fromDomainEndpoint

      @Stability(Stable) @NotNull public static IDomain fromDomainEndpoint(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String domainEndpoint)
      Creates a domain construct that represents an external domain via domain endpoint.

      Parameters:
      scope - The parent creating construct (usually this). This parameter is required.
      id - The construct's name. This parameter is required.
      domainEndpoint - The domain's endpoint. This parameter is required.
    • addAccessPolicies

      @Stability(Stable) public void addAccessPolicies(@NotNull @NotNull PolicyStatement... accessPolicyStatements)
      Add policy statements to the domain access policy.

      Parameters:
      accessPolicyStatements - This parameter is required.
    • grantIndexRead

      @Stability(Stable) @NotNull public Grant grantIndexRead(@NotNull String index, @NotNull IGrantable identity)
      Grant read permissions for an index in this domain to an IAM principal (Role/Group/User).

      Specified by:
      grantIndexRead in interface IDomain
      Parameters:
      index - The index to grant permissions for. This parameter is required.
      identity - The principal. This parameter is required.
    • grantIndexReadWrite

      @Stability(Stable) @NotNull public Grant grantIndexReadWrite(@NotNull String index, @NotNull IGrantable identity)
      Grant read/write permissions for an index in this domain to an IAM principal (Role/Group/User).

      Specified by:
      grantIndexReadWrite in interface IDomain
      Parameters:
      index - The index to grant permissions for. This parameter is required.
      identity - The principal. This parameter is required.
    • grantIndexWrite

      @Stability(Stable) @NotNull public Grant grantIndexWrite(@NotNull String index, @NotNull IGrantable identity)
      Grant write permissions for an index in this domain to an IAM principal (Role/Group/User).

      Specified by:
      grantIndexWrite in interface IDomain
      Parameters:
      index - The index to grant permissions for. This parameter is required.
      identity - The principal. This parameter is required.
    • grantPathRead

      @Stability(Stable) @NotNull public Grant grantPathRead(@NotNull String path, @NotNull IGrantable identity)
      Grant read permissions for a specific path in this domain to an IAM principal (Role/Group/User).

      Specified by:
      grantPathRead in interface IDomain
      Parameters:
      path - The path to grant permissions for. This parameter is required.
      identity - The principal. This parameter is required.
    • grantPathReadWrite

      @Stability(Stable) @NotNull public Grant grantPathReadWrite(@NotNull String path, @NotNull IGrantable identity)
      Grant read/write permissions for a specific path in this domain to an IAM principal (Role/Group/User).

      Specified by:
      grantPathReadWrite in interface IDomain
      Parameters:
      path - The path to grant permissions for. This parameter is required.
      identity - The principal. This parameter is required.
    • grantPathWrite

      @Stability(Stable) @NotNull public Grant grantPathWrite(@NotNull String path, @NotNull IGrantable identity)
      Grant write permissions for a specific path in this domain to an IAM principal (Role/Group/User).

      Specified by:
      grantPathWrite in interface IDomain
      Parameters:
      path - The path to grant permissions for. This parameter is required.
      identity - The principal. This parameter is required.
    • grantRead

      @Stability(Stable) @NotNull public Grant grantRead(@NotNull IGrantable identity)
      Grant read permissions for this domain and its contents to an IAM principal (Role/Group/User).

      Specified by:
      grantRead in interface IDomain
      Parameters:
      identity - The principal. This parameter is required.
    • grantReadWrite

      @Stability(Stable) @NotNull public Grant grantReadWrite(@NotNull IGrantable identity)
      Grant read/write permissions for this domain and its contents to an IAM principal (Role/Group/User).

      Specified by:
      grantReadWrite in interface IDomain
      Parameters:
      identity - The principal. This parameter is required.
    • grantWrite

      @Stability(Stable) @NotNull public Grant grantWrite(@NotNull IGrantable identity)
      Grant write permissions for this domain and its contents to an IAM principal (Role/Group/User).

      Specified by:
      grantWrite in interface IDomain
      Parameters:
      identity - The principal. This parameter is required.
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this domain.

      Specified by:
      metric in interface IDomain
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this domain.

      Specified by:
      metric in interface IDomain
      Parameters:
      metricName - This parameter is required.
    • metricAutomatedSnapshotFailure

      @Stability(Stable) @NotNull public Metric metricAutomatedSnapshotFailure(@Nullable MetricOptions props)
      Metric for automated snapshot failures.

      Default: maximum over 5 minutes

      Specified by:
      metricAutomatedSnapshotFailure in interface IDomain
      Parameters:
      props -
    • metricAutomatedSnapshotFailure

      @Stability(Stable) @NotNull public Metric metricAutomatedSnapshotFailure()
      Metric for automated snapshot failures.

      Default: maximum over 5 minutes

      Specified by:
      metricAutomatedSnapshotFailure in interface IDomain
    • metricClusterIndexWritesBlocked

      @Stability(Stable) @NotNull public Metric metricClusterIndexWritesBlocked(@Nullable MetricOptions props)
      Metric for the cluster blocking index writes.

      Default: maximum over 1 minute

      Specified by:
      metricClusterIndexWritesBlocked in interface IDomain
      Parameters:
      props -
    • metricClusterIndexWritesBlocked

      @Stability(Stable) @NotNull public Metric metricClusterIndexWritesBlocked()
      Metric for the cluster blocking index writes.

      Default: maximum over 1 minute

      Specified by:
      metricClusterIndexWritesBlocked in interface IDomain
    • metricClusterStatusRed

      @Stability(Stable) @NotNull public Metric metricClusterStatusRed(@Nullable MetricOptions props)
      Metric for the time the cluster status is red.

      Default: maximum over 5 minutes

      Specified by:
      metricClusterStatusRed in interface IDomain
      Parameters:
      props -
    • metricClusterStatusRed

      @Stability(Stable) @NotNull public Metric metricClusterStatusRed()
      Metric for the time the cluster status is red.

      Default: maximum over 5 minutes

      Specified by:
      metricClusterStatusRed in interface IDomain
    • metricClusterStatusYellow

      @Stability(Stable) @NotNull public Metric metricClusterStatusYellow(@Nullable MetricOptions props)
      Metric for the time the cluster status is yellow.

      Default: maximum over 5 minutes

      Specified by:
      metricClusterStatusYellow in interface IDomain
      Parameters:
      props -
    • metricClusterStatusYellow

      @Stability(Stable) @NotNull public Metric metricClusterStatusYellow()
      Metric for the time the cluster status is yellow.

      Default: maximum over 5 minutes

      Specified by:
      metricClusterStatusYellow in interface IDomain
    • metricCPUUtilization

      @Stability(Stable) @NotNull public Metric metricCPUUtilization(@Nullable MetricOptions props)
      Metric for CPU utilization.

      Default: maximum over 5 minutes

      Specified by:
      metricCPUUtilization in interface IDomain
      Parameters:
      props -
    • metricCPUUtilization

      @Stability(Stable) @NotNull public Metric metricCPUUtilization()
      Metric for CPU utilization.

      Default: maximum over 5 minutes

      Specified by:
      metricCPUUtilization in interface IDomain
    • metricFreeStorageSpace

      @Stability(Stable) @NotNull public Metric metricFreeStorageSpace(@Nullable MetricOptions props)
      Metric for the storage space of nodes in the cluster.

      Default: minimum over 5 minutes

      Specified by:
      metricFreeStorageSpace in interface IDomain
      Parameters:
      props -
    • metricFreeStorageSpace

      @Stability(Stable) @NotNull public Metric metricFreeStorageSpace()
      Metric for the storage space of nodes in the cluster.

      Default: minimum over 5 minutes

      Specified by:
      metricFreeStorageSpace in interface IDomain
    • metricIndexingLatency

      @Stability(Stable) @NotNull public Metric metricIndexingLatency(@Nullable MetricOptions props)
      Metric for indexing latency.

      Default: p99 over 5 minutes

      Specified by:
      metricIndexingLatency in interface IDomain
      Parameters:
      props -
    • metricIndexingLatency

      @Stability(Stable) @NotNull public Metric metricIndexingLatency()
      Metric for indexing latency.

      Default: p99 over 5 minutes

      Specified by:
      metricIndexingLatency in interface IDomain
    • metricJVMMemoryPressure

      @Stability(Stable) @NotNull public Metric metricJVMMemoryPressure(@Nullable MetricOptions props)
      Metric for JVM memory pressure.

      Default: maximum over 5 minutes

      Specified by:
      metricJVMMemoryPressure in interface IDomain
      Parameters:
      props -
    • metricJVMMemoryPressure

      @Stability(Stable) @NotNull public Metric metricJVMMemoryPressure()
      Metric for JVM memory pressure.

      Default: maximum over 5 minutes

      Specified by:
      metricJVMMemoryPressure in interface IDomain
    • metricKMSKeyError

      @Stability(Stable) @NotNull public Metric metricKMSKeyError(@Nullable MetricOptions props)
      Metric for KMS key errors.

      Default: maximum over 5 minutes

      Specified by:
      metricKMSKeyError in interface IDomain
      Parameters:
      props -
    • metricKMSKeyError

      @Stability(Stable) @NotNull public Metric metricKMSKeyError()
      Metric for KMS key errors.

      Default: maximum over 5 minutes

      Specified by:
      metricKMSKeyError in interface IDomain
    • metricKMSKeyInaccessible

      @Stability(Stable) @NotNull public Metric metricKMSKeyInaccessible(@Nullable MetricOptions props)
      Metric for KMS key being inaccessible.

      Default: maximum over 5 minutes

      Specified by:
      metricKMSKeyInaccessible in interface IDomain
      Parameters:
      props -
    • metricKMSKeyInaccessible

      @Stability(Stable) @NotNull public Metric metricKMSKeyInaccessible()
      Metric for KMS key being inaccessible.

      Default: maximum over 5 minutes

      Specified by:
      metricKMSKeyInaccessible in interface IDomain
    • metricMasterCPUUtilization

      @Stability(Stable) @NotNull public Metric metricMasterCPUUtilization(@Nullable MetricOptions props)
      Metric for master CPU utilization.

      Default: maximum over 5 minutes

      Specified by:
      metricMasterCPUUtilization in interface IDomain
      Parameters:
      props -
    • metricMasterCPUUtilization

      @Stability(Stable) @NotNull public Metric metricMasterCPUUtilization()
      Metric for master CPU utilization.

      Default: maximum over 5 minutes

      Specified by:
      metricMasterCPUUtilization in interface IDomain
    • metricMasterJVMMemoryPressure

      @Stability(Stable) @NotNull public Metric metricMasterJVMMemoryPressure(@Nullable MetricOptions props)
      Metric for master JVM memory pressure.

      Default: maximum over 5 minutes

      Specified by:
      metricMasterJVMMemoryPressure in interface IDomain
      Parameters:
      props -
    • metricMasterJVMMemoryPressure

      @Stability(Stable) @NotNull public Metric metricMasterJVMMemoryPressure()
      Metric for master JVM memory pressure.

      Default: maximum over 5 minutes

      Specified by:
      metricMasterJVMMemoryPressure in interface IDomain
    • metricNodes

      @Stability(Stable) @NotNull public Metric metricNodes(@Nullable MetricOptions props)
      Metric for the number of nodes.

      Default: minimum over 1 hour

      Specified by:
      metricNodes in interface IDomain
      Parameters:
      props -
    • metricNodes

      @Stability(Stable) @NotNull public Metric metricNodes()
      Metric for the number of nodes.

      Default: minimum over 1 hour

      Specified by:
      metricNodes in interface IDomain
    • metricSearchableDocuments

      @Stability(Stable) @NotNull public Metric metricSearchableDocuments(@Nullable MetricOptions props)
      Metric for number of searchable documents.

      Default: maximum over 5 minutes

      Specified by:
      metricSearchableDocuments in interface IDomain
      Parameters:
      props -
    • metricSearchableDocuments

      @Stability(Stable) @NotNull public Metric metricSearchableDocuments()
      Metric for number of searchable documents.

      Default: maximum over 5 minutes

      Specified by:
      metricSearchableDocuments in interface IDomain
    • metricSearchLatency

      @Stability(Stable) @NotNull public Metric metricSearchLatency(@Nullable MetricOptions props)
      Metric for search latency.

      Default: p99 over 5 minutes

      Specified by:
      metricSearchLatency in interface IDomain
      Parameters:
      props -
    • metricSearchLatency

      @Stability(Stable) @NotNull public Metric metricSearchLatency()
      Metric for search latency.

      Default: p99 over 5 minutes

      Specified by:
      metricSearchLatency in interface IDomain
    • getConnections

      @Stability(Stable) @NotNull public Connections getConnections()
      Manages network connections to the domain.

      This will throw an error in case the domain is not placed inside a VPC.

      Specified by:
      getConnections in interface IConnectable
    • getDomainArn

      @Stability(Stable) @NotNull public String getDomainArn()
      Arn of the Amazon OpenSearch Service domain.
      Specified by:
      getDomainArn in interface IDomain
    • getDomainEndpoint

      @Stability(Stable) @NotNull public String getDomainEndpoint()
      Endpoint of the Amazon OpenSearch Service domain.
      Specified by:
      getDomainEndpoint in interface IDomain
    • getDomainId

      @Stability(Stable) @NotNull public String getDomainId()
      Identifier of the Amazon OpenSearch Service domain.
      Specified by:
      getDomainId in interface IDomain
    • getDomainName

      @Stability(Stable) @NotNull public String getDomainName()
      Domain name of the Amazon OpenSearch Service domain.
      Specified by:
      getDomainName in interface IDomain
    • getAppLogGroup

      @Stability(Stable) @Nullable public ILogGroup getAppLogGroup()
      Log group that application logs are logged to.
    • getAuditLogGroup

      @Stability(Stable) @Nullable public ILogGroup getAuditLogGroup()
      Log group that audit logs are logged to.
    • getMasterUserPassword

      @Stability(Stable) @Nullable public SecretValue getMasterUserPassword()
      Master user password if fine grained access control is configured.
    • getSlowIndexLogGroup

      @Stability(Stable) @Nullable public ILogGroup getSlowIndexLogGroup()
      Log group that slow indices are logged to.
    • getSlowSearchLogGroup

      @Stability(Stable) @Nullable public ILogGroup getSlowSearchLogGroup()
      Log group that slow searches are logged to.