# AppSyncDomainOptions

Domain name configuration for AppSync.

- Source: [`aws-appsync/lib/appsync-common.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appsync/lib/appsync-common.ts#L140)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

```ts
import * as acm from 'aws-cdk-lib/aws-certificatemanager';
import * as route53 from 'aws-cdk-lib/aws-route53';

const myDomainName = 'api.example.com';
const certificate = new acm.Certificate(this, 'cert', { domainName: myDomainName });

const apiKeyProvider: appsync.AppSyncAuthProvider = {
  authorizationType: appsync.AppSyncAuthorizationType.API_KEY,
};

const api = new appsync.EventApi(this, 'api', {
  apiName: 'Api',
  ownerContact: 'OwnerContact',
  authorizationConfig: {
    authProviders: [
      apiKeyProvider,
    ],
    connectionAuthModeTypes: [
      appsync.AppSyncAuthorizationType.API_KEY,
    ],
    defaultPublishAuthModeTypes: [
      appsync.AppSyncAuthorizationType.API_KEY,
    ],
    defaultSubscribeAuthModeTypes: [
      appsync.AppSyncAuthorizationType.API_KEY,
    ],
  },
  // Custom Domain Settings
  domainName: {
    certificate,
    domainName: myDomainName,
  },
});

api.addChannelNamespace('default');

// You can get custom HTTP/Realtime endpoint
new CfnOutput(this, 'AWS AppSync Events HTTP endpoint', { value: api.customHttpEndpoint });
new CfnOutput(this, 'AWS AppSync Events Realtime endpoint', { value: api.customRealtimeEndpoint });
```

## Properties

- `certificate`: [ICertificateRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_certificatemanager.ICertificateRef.html) (required) — The certificate to use with the domain name.

- `domainName`: string (required) — The actual domain name.

  For example, `api.example.com`.
