# DomainNameOptions

Used as argument in: [RestApiBase.addDomainName](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApiBase.html#adddomainname)

- Source: [`aws-apigateway/lib/domain-name.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigateway/lib/domain-name.ts#L114)
- Type last changed: v2.242.0 · 10 Mar 2026

## Example

TypeScript:

```ts
declare const acmCertificateForExampleCom: any;

const api = new apigateway.RestApi(this, 'MyDomain', {
  domainName: {
    domainName: 'example.com',
    certificate: acmCertificateForExampleCom,
  },
});
```

Python:

```python
# acm_certificate_for_example_com: Any

api = apigateway.RestApi(self, "MyDomain",
    domain_name=apigateway.DomainNameOptions(
        domain_name="example.com",
        certificate=acm_certificate_for_example_com
    )
)
```

Java:

```java
Object acmCertificateForExampleCom;

RestApi api = RestApi.Builder.create(this, "MyDomain")
        .domainName(DomainNameOptions.builder()
                .domainName("example.com")
                .certificate(acmCertificateForExampleCom)
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var acmCertificateForExampleCom;

var api = new RestApi(this, "MyDomain", new RestApiProps {
    DomainName = new DomainNameOptions {
        DomainName = "example.com",
        Certificate = acmCertificateForExampleCom
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var acmCertificateForExampleCom interface{}

api := apigateway.NewRestApi(this, jsii.String("MyDomain"), &RestApiProps{
	DomainName: &DomainNameOptions{
		DomainName: jsii.String("example.com"),
		Certificate: acmCertificateForExampleCom,
	},
})
```

## Properties

- `basePath`: string — The base path name that callers of the API must provide in the URL after the domain name (e.g. `example.com/base-path`). If you specify this property, it can't be an empty string.

  **Default:** map requests from the domain root (e.g. `example.com`).

- `certificate`: [ICertificateRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_certificatemanager.ICertificateRef.html) (required) — The reference to an AWS-managed certificate for use by the edge-optimized endpoint for the domain name.

  For "EDGE" domain names, the certificate
  needs to be in the US East (N. Virginia) region.

- `domainName`: string (required) — The custom domain name for your API.

  Uppercase letters are not supported.

- `endpointAccessMode`: [EndpointAccessMode](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.EndpointAccessMode.html) — The endpoint access mode for this domain name.

  **Default:** No endpoint access mode is configured. Required for enhanced security policies.

  When using enhanced security policies (those starting with `SecurityPolicy_`),
  you must specify this property. STRICT is recommended for production workloads,
  but BASIC may be needed during migration or for certain application architectures.

- `endpointType`: [EndpointType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.EndpointType.html) = REGIONAL — The type of endpoint for this DomainName.

- `mtls`: [MTLSConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MTLSConfig.html) — The mutual TLS authentication configuration for a custom domain name.

  **Default:** mTLS is not configured.

- `securityPolicy`: [SecurityPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.SecurityPolicy.html) = SecurityPolicy.TLS_1_2 — The Transport Layer Security (TLS) version + cipher suite for this domain name.
