# DomainMappingOptions

Options for DomainMapping.

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

## Example

```ts
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';

declare const handler: lambda.Function;
declare const dn: apigwv2.DomainName;

const apiDemo = new apigwv2.HttpApi(this, 'DemoApi', {
  defaultIntegration: new HttpLambdaIntegration('DefaultIntegration', handler),
  // https://${dn.domainName}/demo goes to apiDemo $default stage
  defaultDomainMapping: {
    domainName: dn,
    mappingKey: 'demo',
  },
});
```

## Properties

- `domainName`: [IDomainNameRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_apigatewayv2.IDomainNameRef.html) (required) — The domain name for the mapping.

- `mappingKey`: string — The API mapping key.

  **Default:** empty key for the root path mapping

  Leave it undefined for the root path mapping.
