# CustomEndpointOptions

Configures a custom domain endpoint for the ES domain.

- Source: [`aws-elasticsearch/lib/domain.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-elasticsearch/lib/domain.ts#L474)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

TypeScript:

```ts
new es.Domain(this, 'Domain', {
  version: es.ElasticsearchVersion.V7_7,
  customEndpoint: {
    domainName: 'search.example.com',
  },
});
```

Python:

```python
es.Domain(self, "Domain",
    version=es.ElasticsearchVersion.V7_7,
    custom_endpoint=es.CustomEndpointOptions(
        domain_name="search.example.com"
    )
)
```

Java:

```java
Domain.Builder.create(this, "Domain")
        .version(ElasticsearchVersion.V7_7)
        .customEndpoint(CustomEndpointOptions.builder()
                .domainName("search.example.com")
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new Domain(this, "Domain", new DomainProps {
    Version = ElasticsearchVersion.V7_7,
    CustomEndpoint = new CustomEndpointOptions {
        DomainName = "search.example.com"
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
es.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: es.ElasticsearchVersion_V7_7(),
	CustomEndpoint: &CustomEndpointOptions{
		DomainName: jsii.String("search.example.com"),
	},
})
```

## Properties

- `certificate`: [ICertificateRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_certificatemanager.ICertificateRef.html) — use opensearchservice module instead

  **Default:** create a new one

- `domainName`: string (required) — use opensearchservice module instead

- `hostedZone`: [IHostedZone](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53.IHostedZone.html) — use opensearchservice module instead

  **Default:** do not create a CNAME
