# HttpApiProps

Properties to initialize an instance of `HttpApi`.

Extends: HttpApiProps
Used as props by: HttpApi

- Source: [`aws-apigatewayv2/lib/http/api.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/http/api.ts#L131)
- Type last changed: v2.189.0 · 9 Apr 2025

## Example

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

declare const lb: elbv2.ApplicationLoadBalancer;
const listener = lb.addListener('listener', { port: 80 });
listener.addTargets('target', {
  port: 80,
});

const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
  defaultIntegration: new HttpAlbIntegration('DefaultIntegration', listener, {
    parameterMapping: new apigwv2.ParameterMapping().custom('myKey', 'myValue'),
  }),
});
```

## Properties

- `apiName`: string — Name for the HTTP API resource.

  **Default:** id of the HttpApi construct.

- `corsPreflight`: [CorsPreflightOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.CorsPreflightOptions.html) — Specifies a CORS configuration for an API.

  **Default:** CORS disabled.

- `createDefaultStage`: boolean = true — Whether a default stage and deployment should be automatically created.

- `defaultAuthorizationScopes`: string[] — Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.

  **Default:** no default authorization scopes

  The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation.

- `defaultAuthorizer`: [IHttpRouteAuthorizer](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IHttpRouteAuthorizer.html) — Default Authorizer applied to all routes in the gateway.

  **Default:** no default authorizer

- `defaultDomainMapping`: [DomainMappingOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.DomainMappingOptions.html) — Configure a custom domain with the API mapping resource to the HTTP API.

  **Default:** no default domain mapping configured. meaningless if `createDefaultStage` is `false`.

- `defaultIntegration`: [HttpRouteIntegration](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.HttpRouteIntegration.html) = none — An integration that will be configured on the catch-all route ($default).

- `description`: string = none — The description of the API.

- `disableExecuteApiEndpoint`: boolean — Specifies whether clients can invoke your API using the default endpoint.

  **Default:** false execute-api endpoint enabled.

  By default, clients can invoke your API with the default
  `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. Set this to
  true if you would like clients to use your custom domain name.

- `ipAddressType`: [IpAddressType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IpAddressType.html) — The IP address types that can invoke the API.

  **Default:** undefined - AWS default is IPV4

- `routeSelectionExpression`: boolean = false — Whether to set the default route selection expression for the API.

  When enabled, "${request.method} ${request.path}" is set as the default route selection expression.
