Package software.amazon.awscdk.services.apigatewayv2
AWS APIGatewayv2 Construct Library
Table of Contents
Introduction
Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud. As an API Gateway API developer, you can create APIs for use in your own client applications. Read the Amazon API Gateway Developer Guide.
This module supports features under API Gateway v2
that lets users set up Websocket and HTTP APIs.
REST APIs can be created using the aws-cdk-lib/aws-apigateway module.
HTTP and Websocket APIs use the same CloudFormation resources under the hood. However, this module separates them into two separate constructs for a more efficient abstraction since there are a number of CloudFormation properties that specifically apply only to each type of API.
HTTP API
HTTP APIs enable creation of RESTful APIs that integrate with AWS Lambda functions, known as Lambda proxy integration, or to any routable HTTP endpoint, known as HTTP proxy integration.
Defining HTTP APIs
HTTP APIs have two fundamental concepts - Routes and Integrations.
Routes direct incoming API requests to backend resources. Routes consist of two parts: an HTTP method and a resource
path, such as, GET /books. Learn more at Working with
routes. Use the ANY method
to match any methods for a route that are not explicitly defined.
Integrations define how the HTTP API responds when a client reaches a specific Route. HTTP APIs support Lambda proxy integration, HTTP proxy integration and, AWS service integrations, also known as private integrations. Learn more at Configuring integrations.
Integrations are available at the aws-apigatewayv2-integrations module and more information is available in that module.
As an early example, we have a website for a bookstore where the following code snippet configures a route GET /books with an HTTP proxy integration. All other HTTP method calls to /books route to a default lambda proxy for the bookstore.
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpUrlIntegration;
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpLambdaIntegration;
Function bookStoreDefaultFn;
HttpUrlIntegration getBooksIntegration = new HttpUrlIntegration("GetBooksIntegration", "https://get-books-proxy.example.com");
HttpLambdaIntegration bookStoreDefaultIntegration = new HttpLambdaIntegration("BooksIntegration", bookStoreDefaultFn);
HttpApi httpApi = new HttpApi(this, "HttpApi");
httpApi.addRoutes(AddRoutesOptions.builder()
.path("/books")
.methods(List.of(HttpMethod.GET))
.integration(getBooksIntegration)
.build());
httpApi.addRoutes(AddRoutesOptions.builder()
.path("/books")
.methods(List.of(HttpMethod.ANY))
.integration(bookStoreDefaultIntegration)
.build());
The URL to the endpoint can be retrieved via the apiEndpoint attribute. By default this URL is enabled for clients. Use disableExecuteApiEndpoint to disable it.
HttpApi httpApi = HttpApi.Builder.create(this, "HttpApi")
.disableExecuteApiEndpoint(true)
.build();
The defaultIntegration option while defining HTTP APIs lets you create a default catch-all integration that is
matched when a client reaches a route that is not explicitly defined.
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpUrlIntegration;
HttpApi.Builder.create(this, "HttpProxyApi")
.defaultIntegration(new HttpUrlIntegration("DefaultIntegration", "https://example.com"))
.build();
The routeSelectionExpression option allows configuring the HTTP API to accept only ${request.method} ${request.path}. Setting it to true automatically applies this value.
HttpApi.Builder.create(this, "HttpProxyApi")
.routeSelectionExpression(true)
.build();
You can configure IP address type for the API endpoint using ipAddressType property.
Valid values are IPV4 (default) and DUAL_STACK.
HttpApi.Builder.create(this, "HttpApi")
.ipAddressType(IpAddressType.DUAL_STACK)
.build();
Cross Origin Resource Sharing (CORS)
Cross-origin resource sharing (CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. Enabling CORS will allow requests to your API from a web application hosted in a domain different from your API domain.
When configured CORS for an HTTP API, API Gateway automatically sends a response to preflight OPTIONS requests, even
if there isn't an OPTIONS route configured. Note that, when this option is used, API Gateway will ignore CORS headers
returned from your backend integration. Learn more about Configuring CORS for an HTTP
API.
The corsPreflight option lets you specify a CORS configuration for an API.
HttpApi.Builder.create(this, "HttpProxyApi")
.corsPreflight(CorsPreflightOptions.builder()
.allowHeaders(List.of("Authorization"))
.allowMethods(List.of(CorsHttpMethod.GET, CorsHttpMethod.HEAD, CorsHttpMethod.OPTIONS, CorsHttpMethod.POST))
.allowOrigins(List.of("*"))
.maxAge(Duration.days(10))
.build())
.build();
Publishing HTTP APIs
A Stage is a logical reference to a lifecycle state of your API (for example, dev, prod, beta, or v2). API
stages are identified by their stage name. Each stage is a named reference to a deployment of the API made available for
client applications to call.
Use HttpStage to create a Stage resource for HTTP APIs. The following code sets up a Stage, whose URL is available at
https://{api_id}.execute-api.{region}.amazonaws.com/beta.
HttpApi api;
HttpStage.Builder.create(this, "Stage")
.httpApi(api)
.stageName("beta")
.description("My Stage")
.build();
If you omit the stageName will create a $default stage. A $default stage is one that is served from the base of
the API's URL - https://{api_id}.execute-api.{region}.amazonaws.com/.
Note that, HttpApi will always creates a $default stage, unless the createDefaultStage property is unset.
Custom Domain
Custom domain names are simpler and more intuitive URLs that you can provide to your API users. Custom domain name are associated to API stages.
The code snippet below creates a custom domain and configures a default domain mapping for your API that maps the
custom domain to the $default stage of the API.
import software.amazon.awscdk.services.certificatemanager.*;
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpLambdaIntegration;
Function handler;
String certArn = "arn:aws:acm:us-east-1:111111111111:certificate";
String domainName = "example.com";
DomainName dn = DomainName.Builder.create(this, "DN")
.domainName(domainName)
.certificate(Certificate.fromCertificateArn(this, "cert", certArn))
.build();
HttpApi api = HttpApi.Builder.create(this, "HttpProxyProdApi")
.defaultIntegration(new HttpLambdaIntegration("DefaultIntegration", handler))
// https://${dn.domainName}/foo goes to prodApi $default stage
.defaultDomainMapping(DomainMappingOptions.builder()
.domainName(dn)
.mappingKey("foo")
.build())
.build();
To migrate a domain endpoint from one type to another, you can add a new endpoint configuration via addEndpoint()
and then configure DNS records to route traffic to the new endpoint. After that, you can remove the previous endpoint configuration.
Learn more at Migrating a custom domain name
To associate a specific Stage to a custom domain mapping -
HttpApi api;
DomainName dn;
api.addStage("beta", HttpStageOptions.builder()
.stageName("beta")
.autoDeploy(true)
// https://${dn.domainName}/bar goes to the beta stage
.domainMapping(DomainMappingOptions.builder()
.domainName(dn)
.mappingKey("bar")
.build())
.build());
The same domain name can be associated with stages across different HttpApi as so -
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpLambdaIntegration;
Function handler;
DomainName dn;
HttpApi apiDemo = HttpApi.Builder.create(this, "DemoApi")
.defaultIntegration(new HttpLambdaIntegration("DefaultIntegration", handler))
// https://${dn.domainName}/demo goes to apiDemo $default stage
.defaultDomainMapping(DomainMappingOptions.builder()
.domainName(dn)
.mappingKey("demo")
.build())
.build();
The mappingKey determines the base path of the URL with the custom domain. Each custom domain is only allowed
to have one API mapping with undefined mappingKey. If more than one API mappings are specified, mappingKey will be required for all of them. In the sample above, the custom domain is associated
with 3 API mapping resources across different APIs and Stages.
| API | Stage | URL |
| :------------: | :---------: | :----: |
| api | $default | https://${domainName}/foo |
| api | beta | https://${domainName}/bar |
| apiDemo | $default | https://${domainName}/demo |
You can retrieve the full domain URL with mapping key using the domainUrl property as so -
HttpApi apiDemo; String demoDomainUrl = apiDemo.getDefaultStage().getDomainUrl();
Mutual TLS (mTLS)
Mutual TLS can be configured to limit access to your API based by using client certificates instead of (or as an extension of) using authorization headers.
import software.amazon.awscdk.services.s3.*;
import software.amazon.awscdk.services.certificatemanager.*;
Bucket bucket;
String certArn = "arn:aws:acm:us-east-1:111111111111:certificate";
String domainName = "example.com";
DomainName.Builder.create(this, "DomainName")
.domainName(domainName)
.certificate(Certificate.fromCertificateArn(this, "cert", certArn))
.mtls(MTLSConfig.builder()
.bucket(bucket)
.key("someca.pem")
.version("version")
.build())
.build();
Instructions for configuring your trust store can be found here
Managing access to HTTP APIs
API Gateway supports multiple mechanisms for controlling and managing access to your HTTP API through authorizers.
These authorizers can be found in the APIGatewayV2-Authorizers constructs library.
Metrics
The API Gateway v2 service sends metrics around the performance of HTTP APIs to Amazon CloudWatch.
These metrics can be referred to using the metric APIs available on the HttpApi construct.
The APIs with the metric prefix can be used to get reference to specific metrics for this API. For example,
the method below refers to the client side errors metric for this API.
HttpApi api = new HttpApi(this, "my-api"); Metric clientErrorMetric = api.metricClientError();
Please note that this will return a metric for all the stages defined in the api. It is also possible to refer to metrics for a specific Stage using
the metric methods from the Stage construct.
HttpApi api = new HttpApi(this, "my-api");
HttpStage stage = HttpStage.Builder.create(this, "Stage")
.httpApi(api)
.build();
Metric clientErrorMetric = stage.metricClientError();
VPC Link
Private integrations let HTTP APIs connect with AWS resources that are placed behind a VPC. These are usually Application
Load Balancers, Network Load Balancers or a Cloud Map service. The VpcLink construct enables this integration.
The following code creates a VpcLink to a private VPC.
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.elasticloadbalancingv2.*;
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpAlbIntegration;
Vpc vpc = new Vpc(this, "VPC");
ApplicationLoadBalancer alb = ApplicationLoadBalancer.Builder.create(this, "AppLoadBalancer").vpc(vpc).build();
VpcLink vpcLink = VpcLink.Builder.create(this, "VpcLink").vpc(vpc).build();
// Creating an HTTP ALB Integration:
HttpAlbIntegration albIntegration = HttpAlbIntegration.Builder.create("ALBIntegration", alb.getListeners()[0]).build();
Any existing VpcLink resource can be imported into the CDK app via the VpcLink.fromVpcLinkAttributes().
import software.amazon.awscdk.services.ec2.*;
Vpc vpc;
IVpcLink awesomeLink = VpcLink.fromVpcLinkAttributes(this, "awesome-vpc-link", VpcLinkAttributes.builder()
.vpcLinkId("us-east-1_oiuR12Abd")
.vpc(vpc)
.build());
Private Integration
Private integrations enable integrating an HTTP API route with private resources in a VPC, such as Application Load Balancers or Amazon ECS container-based applications. Using private integrations, resources in a VPC can be exposed for access by clients outside of the VPC.
These integrations can be found in the aws-apigatewayv2-integrations constructs library.
Generating ARN for Execute API
The arnForExecuteApi function in AWS CDK is designed to generate Amazon Resource Names (ARNs) for Execute API operations. This is particularly useful when you need to create ARNs dynamically based on different parameters like HTTP method, API path, and stage.
HttpApi api = new HttpApi(this, "my-api");
String arn = api.arnForExecuteApi("GET", "/myApiPath", "dev");
- Ensure that the path parameter, if provided, starts with '/'.
- The 'ANY' method can be used for matching any HTTP methods not explicitly defined.
- The function gracefully handles undefined parameters by using wildcards, making it flexible for various API configurations.
Access Logging
You can turn on logging to write logs to CloudWatch Logs. Read more at Configure logging for HTTP APIs in API Gateway
import software.amazon.awscdk.services.logs.*;
HttpApi api;
LogGroup logGroup;
HttpStage stage = HttpStage.Builder.create(this, "Stage")
.httpApi(api)
.accessLogSettings(Map.of(
"destination", new LogGroupLogDestination(logGroup)))
.build();
The following code will generate the access log in the CLF format.
import software.amazon.awscdk.services.apigateway.*;
import software.amazon.awscdk.services.logs.*;
HttpApi api;
LogGroup logGroup;
HttpStage stage = HttpStage.Builder.create(this, "Stage")
.httpApi(api)
.accessLogSettings(Map.of(
"destination", new LogGroupLogDestination(logGroup),
"format", AccessLogFormat.clf()))
.build();
You can also configure your own access log format by using the AccessLogFormat.custom() API.
AccessLogField provides commonly used fields. The following code configures access log to contain.
import software.amazon.awscdk.services.apigateway.*;
import software.amazon.awscdk.services.logs.*;
HttpApi api;
LogGroup logGroup;
HttpStage stage = HttpStage.Builder.create(this, "Stage")
.httpApi(api)
.accessLogSettings(Map.of(
"destination", new LogGroupLogDestination(logGroup),
"format", AccessLogFormat.custom(String.format("%s %s %s%n %s %s", AccessLogField.contextRequestId(), AccessLogField.contextErrorMessage(), AccessLogField.contextErrorMessageString(), AccessLogField.contextAuthorizerError(), AccessLogField.contextAuthorizerIntegrationStatus()))))
.build();
WebSocket API
A WebSocket API in API Gateway is a collection of WebSocket routes that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can use API Gateway features to help you with all aspects of the API lifecycle, from creation through monitoring your production APIs. Read more
WebSocket APIs have two fundamental concepts - Routes and Integrations.
WebSocket APIs direct JSON messages to backend integrations based on configured routes. (Non-JSON messages are directed
to the configured $default route.)
Integrations define how the WebSocket API behaves when a client reaches a specific Route. Learn more at Configuring integrations.
Integrations are available in the aws-apigatewayv2-integrations module and more information is available in that module.
To add the default WebSocket routes supported by API Gateway ($connect, $disconnect and $default), configure them as part of api props:
import software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration;
Function connectHandler;
Function disconnectHandler;
Function defaultHandler;
WebSocketApi webSocketApi = WebSocketApi.Builder.create(this, "mywsapi")
.connectRouteOptions(WebSocketRouteOptions.builder().integration(new WebSocketLambdaIntegration("ConnectIntegration", connectHandler)).build())
.disconnectRouteOptions(WebSocketRouteOptions.builder().integration(new WebSocketLambdaIntegration("DisconnectIntegration", disconnectHandler)).build())
.defaultRouteOptions(WebSocketRouteOptions.builder().integration(new WebSocketLambdaIntegration("DefaultIntegration", defaultHandler)).build())
.build();
WebSocketStage.Builder.create(this, "mystage")
.webSocketApi(webSocketApi)
.stageName("dev")
.description("My Stage")
.autoDeploy(true)
.build();
To retrieve a websocket URL and a callback URL:
WebSocketStage webSocketStage;
String webSocketURL = webSocketStage.getUrl();
// wss://${this.api.apiId}.execute-api.${s.region}.${s.urlSuffix}/${urlPath}
String callbackURL = webSocketStage.getCallbackUrl();
To add any other route:
import software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration;
Function messageHandler;
WebSocketApi webSocketApi = new WebSocketApi(this, "mywsapi");
webSocketApi.addRoute("sendmessage", WebSocketRouteOptions.builder()
.integration(new WebSocketLambdaIntegration("SendMessageIntegration", messageHandler))
.build());
To add a route that can return a result:
import software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration;
Function messageHandler;
WebSocketApi webSocketApi = new WebSocketApi(this, "mywsapi");
webSocketApi.addRoute("sendmessage", WebSocketRouteOptions.builder()
.integration(new WebSocketLambdaIntegration("SendMessageIntegration", messageHandler))
.returnResponse(true)
.build());
To import an existing WebSocketApi:
IWebSocketApi webSocketApi = WebSocketApi.fromWebSocketApiAttributes(this, "mywsapi", WebSocketApiAttributes.builder().webSocketId("api-1234").build());
To generate an ARN for Execute API:
WebSocketApi api = new WebSocketApi(this, "mywsapi");
String arn = api.arnForExecuteApiV2("$connect", "dev");
For a detailed explanation of this function, including usage and examples, please refer to the Generating ARN for Execute API section under HTTP API.
You can configure IP address type for the API endpoint using ipAddressType property.
Valid values are IPV4 (default) and DUAL_STACK.
WebSocketApi.Builder.create(this, "WebSocketApi")
.ipAddressType(IpAddressType.DUAL_STACK)
.build();
Manage Connections Permission
Grant permission to use API Gateway Management API of a WebSocket API by calling the grantManageConnections API.
You can use Management API to send a callback message to a connected client, get connection information, or disconnect the client. Learn more at Use @connections commands in your backend service.
Function fn;
WebSocketApi webSocketApi = new WebSocketApi(this, "mywsapi");
WebSocketStage stage = WebSocketStage.Builder.create(this, "mystage")
.webSocketApi(webSocketApi)
.stageName("dev")
.build();
// per stage permission
stage.grantManagementApiAccess(fn);
// for all the stages permission
webSocketApi.grantManageConnections(fn);
Managing access to WebSocket APIs
API Gateway supports multiple mechanisms for controlling and managing access to a WebSocket API through authorizers.
These authorizers can be found in the APIGatewayV2-Authorizers constructs library.
API Keys
Websocket APIs also support usage of API Keys. An API Key is a key that is used to grant access to an API. These are useful for controlling and tracking access to an API, when used together with usage plans. These together allow you to configure controls around API access such as quotas and throttling, along with per-API Key metrics on usage.
To require an API Key when accessing the Websocket API:
WebSocketApi webSocketApi = WebSocketApi.Builder.create(this, "mywsapi")
.apiKeySelectionExpression(WebSocketApiKeySelectionExpression.HEADER_X_API_KEY)
.build();
Common Config
Common config for both HTTP API and WebSocket API
Route Settings
Represents a collection of route settings.
HttpApi api;
HttpStage.Builder.create(this, "Stage")
.httpApi(api)
.throttle(ThrottleSettings.builder()
.rateLimit(1000)
.burstLimit(1000)
.build())
.detailedMetricsEnabled(true)
.build();
-
ClassDescriptionOptions when binding a log destination to a HttpApi Stage.A builder for
AccessLogDestinationConfigAn implementation forAccessLogDestinationConfigOptions for the Route with Integration resource.A builder forAddRoutesOptionsAn implementation forAddRoutesOptionsCreate a new API mapping for API Gateway API endpoint.A fluent builder forApiMapping.The attributes used to import existing ApiMapping.A builder forApiMappingAttributesAn implementation forApiMappingAttributesProperties used to create the ApiMapping resource.A builder forApiMappingPropsAn implementation forApiMappingPropsPayload format version for lambda authorizers.Options used when configuring multiple routes, at once.A builder forBatchHttpRouteOptionsAn implementation forBatchHttpRouteOptionsTheAWS::ApiGatewayV2::Apiresource creates an API.TheBodyS3Locationproperty specifies an S3 location from which to import an OpenAPI definition.A builder forCfnApi.BodyS3LocationPropertyAn implementation forCfnApi.BodyS3LocationPropertyA fluent builder forCfnApi.TheCorsproperty specifies a CORS configuration for an API.A builder forCfnApi.CorsPropertyAn implementation forCfnApi.CorsPropertyTheAWS::ApiGatewayV2::ApiGatewayManagedOverridesresource overrides the default properties of API Gateway-managed resources that are implicitly configured for you when you use quick create.TheAccessLogSettingsproperty overrides the access log settings for an API Gateway-managed stage.A builder forCfnApiGatewayManagedOverrides.AccessLogSettingsPropertyAn implementation forCfnApiGatewayManagedOverrides.AccessLogSettingsPropertyA fluent builder forCfnApiGatewayManagedOverrides.TheIntegrationOverridesproperty overrides the integration settings for an API Gateway-managed integration.An implementation forCfnApiGatewayManagedOverrides.IntegrationOverridesPropertyTheRouteOverridesproperty overrides the route configuration for an API Gateway-managed route.A builder forCfnApiGatewayManagedOverrides.RouteOverridesPropertyAn implementation forCfnApiGatewayManagedOverrides.RouteOverridesPropertyTheRouteSettingsproperty overrides the route settings for an API Gateway-managed route.A builder forCfnApiGatewayManagedOverrides.RouteSettingsPropertyAn implementation forCfnApiGatewayManagedOverrides.RouteSettingsPropertyTheStageOverridesproperty overrides the stage configuration for an API Gateway-managed stage.A builder forCfnApiGatewayManagedOverrides.StageOverridesPropertyAn implementation forCfnApiGatewayManagedOverrides.StageOverridesPropertyProperties for defining aCfnApiGatewayManagedOverrides.A builder forCfnApiGatewayManagedOverridesPropsAn implementation forCfnApiGatewayManagedOverridesPropsTheAWS::ApiGatewayV2::ApiMappingresource contains an API mapping.A fluent builder forCfnApiMapping.Properties for defining aCfnApiMapping.A builder forCfnApiMappingPropsAn implementation forCfnApiMappingPropsProperties for defining aCfnApi.A builder forCfnApiPropsAn implementation forCfnApiPropsTheAWS::ApiGatewayV2::Authorizerresource creates an authorizer for a WebSocket API or an HTTP API.A fluent builder forCfnAuthorizer.TheJWTConfigurationproperty specifies the configuration of a JWT authorizer.A builder forCfnAuthorizer.JWTConfigurationPropertyAn implementation forCfnAuthorizer.JWTConfigurationPropertyProperties for defining aCfnAuthorizer.A builder forCfnAuthorizerPropsAn implementation forCfnAuthorizerPropsTheAWS::ApiGatewayV2::Deploymentresource creates a deployment for an API.A fluent builder forCfnDeployment.Properties for defining aCfnDeployment.A builder forCfnDeploymentPropsAn implementation forCfnDeploymentPropsTheAWS::ApiGatewayV2::DomainNameresource specifies a custom domain name for your API in Amazon API Gateway (API Gateway).A fluent builder forCfnDomainName.TheDomainNameConfigurationproperty type specifies the configuration for an API's domain name.A builder forCfnDomainName.DomainNameConfigurationPropertyAn implementation forCfnDomainName.DomainNameConfigurationPropertyIf specified, API Gateway performs two-way authentication between the client and the server.A builder forCfnDomainName.MutualTlsAuthenticationPropertyAn implementation forCfnDomainName.MutualTlsAuthenticationPropertyProperties for defining aCfnDomainName.A builder forCfnDomainNamePropsAn implementation forCfnDomainNamePropsTheAWS::ApiGatewayV2::Integrationresource creates an integration for an API.A fluent builder forCfnIntegration.Example:A builder forCfnIntegration.ResponseParameterListPropertyAn implementation forCfnIntegration.ResponseParameterListPropertymap of response parameter lists.A builder forCfnIntegration.ResponseParameterMapPropertyAn implementation forCfnIntegration.ResponseParameterMapPropertySupported only for HTTP APIs.A builder forCfnIntegration.ResponseParameterPropertyAn implementation forCfnIntegration.ResponseParameterPropertyTheTlsConfigproperty specifies the TLS configuration for a private integration.A builder forCfnIntegration.TlsConfigPropertyAn implementation forCfnIntegration.TlsConfigPropertyProperties for defining aCfnIntegration.A builder forCfnIntegrationPropsAn implementation forCfnIntegrationPropsTheAWS::ApiGatewayV2::IntegrationResponseresource updates an integration response for an WebSocket API.A fluent builder forCfnIntegrationResponse.Properties for defining aCfnIntegrationResponse.A builder forCfnIntegrationResponsePropsAn implementation forCfnIntegrationResponsePropsTheAWS::ApiGatewayV2::Modelresource updates data model for a WebSocket API.A fluent builder forCfnModel.Properties for defining aCfnModel.A builder forCfnModelPropsAn implementation forCfnModelPropsTheAWS::ApiGatewayV2::Routeresource creates a route for an API.A fluent builder forCfnRoute.Example:A builder forCfnRoute.ParameterConstraintsPropertyAn implementation forCfnRoute.ParameterConstraintsPropertyProperties for defining aCfnRoute.A builder forCfnRoutePropsAn implementation forCfnRoutePropsTheAWS::ApiGatewayV2::RouteResponseresource creates a route response for a WebSocket API.A fluent builder forCfnRouteResponse.Specifies whether the parameter is required.A builder forCfnRouteResponse.ParameterConstraintsPropertyAn implementation forCfnRouteResponse.ParameterConstraintsPropertyProperties for defining aCfnRouteResponse.A builder forCfnRouteResponsePropsAn implementation forCfnRouteResponsePropsTheAWS::ApiGatewayV2::Stageresource specifies a stage for an API.Settings for logging access in a stage.A builder forCfnStage.AccessLogSettingsPropertyAn implementation forCfnStage.AccessLogSettingsPropertyA fluent builder forCfnStage.Represents a collection of route settings.A builder forCfnStage.RouteSettingsPropertyAn implementation forCfnStage.RouteSettingsPropertyProperties for defining aCfnStage.A builder forCfnStagePropsAn implementation forCfnStagePropsTheAWS::ApiGatewayV2::VpcLinkresource creates a VPC link.A fluent builder forCfnVpcLink.Properties for defining aCfnVpcLink.A builder forCfnVpcLinkPropsAn implementation forCfnVpcLinkPropsIntegration content handling.Supported CORS HTTP methods.Options for the CORS Configuration.A builder forCorsPreflightOptionsAn implementation forCorsPreflightOptionsOptions for DomainMapping.A builder forDomainMappingOptionsAn implementation forDomainMappingOptionsCustom domain resource for the API.A fluent builder forDomainName.custom domain name attributes.A builder forDomainNameAttributesAn implementation forDomainNameAttributesproperties used for creating the DomainName.A builder forDomainNamePropsAn implementation forDomainNamePropsproperties for creating a domain name endpoint.A builder forEndpointOptionsAn implementation forEndpointOptionsEndpoint type for a domain name.Options for granting invoke access.A builder forGrantInvokeOptionsAn implementation forGrantInvokeOptionsCreate a new API Gateway HTTP API endpoint.A fluent builder forHttpApi.Attributes for importing an HttpApi into the CDK.A builder forHttpApiAttributesAn implementation forHttpApiAttributesProperties to initialize an instance ofHttpApi.A builder forHttpApiPropsAn implementation forHttpApiPropsAn authorizer for Http Apis.A fluent builder forHttpAuthorizer.Reference to an http authorizer.A builder forHttpAuthorizerAttributesAn implementation forHttpAuthorizerAttributesProperties to initialize an instance ofHttpAuthorizer.A builder forHttpAuthorizerPropsAn implementation forHttpAuthorizerPropsSupported Authorizer types.Supported connection types.The integration for an API route.A fluent builder forHttpIntegration.The integration properties.A builder forHttpIntegrationPropsAn implementation forHttpIntegrationPropsSupported integration subtypes.Supported integration types.Supported HTTP methods.Explicitly configure no authorizers on specific HTTP API routes.Route class that creates the Route for API Gateway HTTP API.A fluent builder forHttpRoute.Input to the bind() operation, that binds an authorizer to a route.A builder forHttpRouteAuthorizerBindOptionsAn implementation forHttpRouteAuthorizerBindOptionsResults of binding an authorizer to an http route.A builder forHttpRouteAuthorizerConfigAn implementation forHttpRouteAuthorizerConfigThe interface that various route integration classes will inherit.Options to the HttpRouteIntegration during its bind operation.A builder forHttpRouteIntegrationBindOptionsAn implementation forHttpRouteIntegrationBindOptionsConfig returned back as a result of the bind.A builder forHttpRouteIntegrationConfigAn implementation forHttpRouteIntegrationConfigHTTP route in APIGateway is a combination of the HTTP method and the path component.Properties to initialize a new Route.A builder forHttpRoutePropsAn implementation forHttpRoutePropsRepresents a stage where an instance of the API is deployed.A fluent builder forHttpStage.The attributes used to import existing HttpStage.A builder forHttpStageAttributesAn implementation forHttpStageAttributesThe options to create a new Stage for an HTTP API.A builder forHttpStageOptionsAn implementation forHttpStageOptionsProperties to initialize an instance ofHttpStage.A builder forHttpStagePropsAn implementation forHttpStagePropsAccess log destination for a HttpApi Stage.Internal default implementation forIAccessLogDestination.A proxy class which represents a concrete javascript instance of this type.Settings for access logging.Internal default implementation forIAccessLogSettings.A proxy class which represents a concrete javascript instance of this type.Represents a API Gateway HTTP/WebSocket API.Internal default implementation forIApi.A proxy class which represents a concrete javascript instance of this type.Represents an ApiGatewayV2 ApiMapping resource.Internal default implementation forIApiMapping.A proxy class which represents a concrete javascript instance of this type.Represents an Authorizer.Internal default implementation forIAuthorizer.A proxy class which represents a concrete javascript instance of this type.Represents an APIGatewayV2 DomainName.Internal default implementation forIDomainName.A proxy class which represents a concrete javascript instance of this type.Represents an HTTP API.Internal default implementation forIHttpApi.A proxy class which represents a concrete javascript instance of this type.An authorizer for HTTP APIs.Internal default implementation forIHttpAuthorizer.A proxy class which represents a concrete javascript instance of this type.Represents an Integration for an HTTP API.Internal default implementation forIHttpIntegration.A proxy class which represents a concrete javascript instance of this type.Represents a Route for an HTTP API.Internal default implementation forIHttpRoute.A proxy class which represents a concrete javascript instance of this type.An authorizer that can attach to an Http Route.Internal default implementation forIHttpRouteAuthorizer.A proxy class which represents a concrete javascript instance of this type.Represents the HttpStage.Internal default implementation forIHttpStage.A proxy class which represents a concrete javascript instance of this type.Represents an integration to an API Route.Internal default implementation forIIntegration.A proxy class which represents a concrete javascript instance of this type.Represents a Mapping Value.Internal default implementation forIMappingValue.A proxy class which represents a concrete javascript instance of this type.Credentials used for AWS Service integrations.Supported IP Address Types.Represents a route.Internal default implementation forIRoute.A proxy class which represents a concrete javascript instance of this type.Represents a Stage.Internal default implementation forIStage.A proxy class which represents a concrete javascript instance of this type.Represents an API Gateway VpcLink.Internal default implementation forIVpcLink.A proxy class which represents a concrete javascript instance of this type.Represents a WebSocket API.Internal default implementation forIWebSocketApi.A proxy class which represents a concrete javascript instance of this type.An authorizer for WebSocket APIs.Internal default implementation forIWebSocketAuthorizer.A proxy class which represents a concrete javascript instance of this type.Represents an Integration for an WebSocket API.Internal default implementation forIWebSocketIntegration.A proxy class which represents a concrete javascript instance of this type.Represents a Route for an WebSocket API.Internal default implementation forIWebSocketRoute.A proxy class which represents a concrete javascript instance of this type.An authorizer that can attach to an WebSocket Route.Internal default implementation forIWebSocketRouteAuthorizer.A proxy class which represents a concrete javascript instance of this type.Represents the WebSocketStage.Internal default implementation forIWebSocketStage.A proxy class which represents a concrete javascript instance of this type.Use CloudWatch Logs as a custom access log destination for API Gateway.Represents a Mapping Value.The mTLS authentication configuration for a custom domain name.A builder forMTLSConfigAn implementation forMTLSConfigRepresents a Parameter Mapping.Integration Passthrough Behavior.Payload format version for lambda proxy integration.The minimum version of the SSL protocol that you want API Gateway to use for HTTPS connections.The attributes used to import existing Stage.A builder forStageAttributesAn implementation forStageAttributesOptions required to create a new stage.A builder forStageOptionsAn implementation forStageOptionsContainer for defining throttling parameters to API stages.A builder forThrottleSettingsAn implementation forThrottleSettingsDefine a new VPC Link Specifies an API Gateway VPC link for a HTTP API to access resources in an Amazon Virtual Private Cloud (VPC).A fluent builder forVpcLink.Attributes when importing a new VpcLink.A builder forVpcLinkAttributesAn implementation forVpcLinkAttributesProperties for a VpcLink.A builder forVpcLinkPropsAn implementation forVpcLinkPropsCreate a new API Gateway WebSocket API endpoint.A fluent builder forWebSocketApi.Attributes for importing a WebSocketApi into the CDK.A builder forWebSocketApiAttributesAn implementation forWebSocketApiAttributesRepresents the currently available API Key Selection Expressions.Props for WebSocket API.A builder forWebSocketApiPropsAn implementation forWebSocketApiPropsAn authorizer for WebSocket Apis.A fluent builder forWebSocketAuthorizer.Reference to an WebSocket authorizer.A builder forWebSocketAuthorizerAttributesAn implementation forWebSocketAuthorizerAttributesProperties to initialize an instance ofWebSocketAuthorizer.A builder forWebSocketAuthorizerPropsAn implementation forWebSocketAuthorizerPropsSupported Authorizer types.The integration for an API route.A fluent builder forWebSocketIntegration.The integration properties.A builder forWebSocketIntegrationPropsAn implementation forWebSocketIntegrationPropsWebSocket Integration Types.Explicitly configure no authorizers on specific WebSocket API routes.Route class that creates the Route for API Gateway WebSocket API.A fluent builder forWebSocketRoute.Input to the bind() operation, that binds an authorizer to a route.A builder forWebSocketRouteAuthorizerBindOptionsAn implementation forWebSocketRouteAuthorizerBindOptionsResults of binding an authorizer to an WebSocket route.A builder forWebSocketRouteAuthorizerConfigAn implementation forWebSocketRouteAuthorizerConfigThe interface that various route integration classes will inherit.Options to the WebSocketRouteIntegration during its bind operation.A builder forWebSocketRouteIntegrationBindOptionsAn implementation forWebSocketRouteIntegrationBindOptionsConfig returned back as a result of the bind.A builder forWebSocketRouteIntegrationConfigAn implementation forWebSocketRouteIntegrationConfigOptions used to add route to the API.A builder forWebSocketRouteOptionsAn implementation forWebSocketRouteOptionsProperties to initialize a new Route.A builder forWebSocketRoutePropsAn implementation forWebSocketRoutePropsRepresents a stage where an instance of the API is deployed.A fluent builder forWebSocketStage.The attributes used to import existing WebSocketStage.A builder forWebSocketStageAttributesAn implementation forWebSocketStageAttributesProperties to initialize an instance ofWebSocketStage.A builder forWebSocketStagePropsAn implementation forWebSocketStageProps