Create a new API Gateway HTTP API endpoint.
import { HttpApi } from 'aws-cdk-lib/aws-apigatewayv2';Or use the module namespace:
import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
// apigatewayv2.HttpApiConfiguration passed to the constructor as HttpApiProps.
apiNameOptionalstringName for the HTTP API resource.
Default: - id of the HttpApi construct.
corsPreflightOptionalCorsPreflightOptionsSpecifies a CORS configuration for an API.
Default: - CORS disabled.
createDefaultStageOptionalbooleanWhether a default stage and deployment should be automatically created.
Default: true
defaultAuthorizationScopesOptionalstring[]Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route. The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation.
Default: - no default authorization scopes
defaultAuthorizerOptionalIHttpRouteAuthorizerDefault Authorizer applied to all routes in the gateway.
Default: - no default authorizer
defaultDomainMappingOptionalDomainMappingOptionsConfigure a custom domain with the API mapping resource to the HTTP API.
Default: - no default domain mapping configured. meaningless if `createDefaultStage` is `false`.
defaultIntegrationOptionalHttpRouteIntegrationAn integration that will be configured on the catch-all route ($default).
Default: - none
descriptionOptionalstringThe description of the API.
Default: - none
disableExecuteApiEndpointOptionalbooleanSpecifies whether clients can invoke your API using the default endpoint. 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.
Default: false execute-api endpoint enabled.
ipAddressTypeOptionalIpAddressTypeThe IP address types that can invoke the API.
Default: undefined - AWS default is IPV4
routeSelectionExpressionOptionalbooleanWhether to set the default route selection expression for the API. When enabled, "${request.method} ${request.path}" is set as the default route selection expression.
Default: false
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-apigatewayv2