# ApiMappingProps

Properties used to create the ApiMapping resource.

Extends: ApiMappingProps
Used as props by: ApiMapping

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

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';
import { aws_apigatewayv2 as interfaces_apigatewayv2 } from 'aws-cdk-lib/interfaces';

declare const apiRef: interfaces_apigatewayv2.IApiRef;
declare const domainNameRef: interfaces_apigatewayv2.IDomainNameRef;
declare const stage: apigatewayv2.IStage;
const apiMappingProps: apigatewayv2.ApiMappingProps = {
  api: apiRef,
  domainName: domainNameRef,

  // the properties below are optional
  apiMappingKey: 'apiMappingKey',
  stage: stage,
};
```

## Properties

- `api`: [IApiRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_apigatewayv2.IApiRef.html) (required) — The Api to which this mapping is applied.

- `apiMappingKey`: string — Api mapping key.

  **Default:** undefined for the root path mapping.

  The path where this stage should be mapped to on the domain

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

- `stage`: [IStage](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IStage.html) — stage for the ApiMapping resource required for WebSocket API defaults to default stage of an HTTP API.

  **Default:** Default stage of the passed API for HTTP API, required for WebSocket API
