HttpLambdaIntegration

class aws_cdk.aws_apigatewayv2_integrations.HttpLambdaIntegration(id, handler, *, parameter_mapping=None, payload_format_version=None)

Bases: HttpRouteIntegration

The Lambda Proxy integration resource for HTTP API.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_apigatewayv2_integrations import HttpLambdaIntegration

# books_default_fn: lambda.Function

books_integration = HttpLambdaIntegration("BooksIntegration", books_default_fn)

http_api = apigwv2.HttpApi(self, "HttpApi")

http_api.add_routes(
    path="/books",
    methods=[apigwv2.HttpMethod.GET],
    integration=books_integration
)
Parameters:
  • id (str) – id of the underlying integration construct.

  • handler (IFunction) – the Lambda handler to integrate with.

  • parameter_mapping (Optional[ParameterMapping]) – Specifies how to transform HTTP requests before sending them to the backend. Default: undefined requests are sent to the backend unmodified

  • payload_format_version (Optional[PayloadFormatVersion]) – Version of the payload sent to the lambda handler. Default: PayloadFormatVersion.VERSION_2_0

Methods

bind(*, route, scope)

Bind this integration to the route.

Parameters:
  • route (IHttpRoute) – The route to which this is being bound.

  • scope (Construct) – The current scope in which the bind is occurring. If the HttpRouteIntegration being bound creates additional constructs, this will be used as their parent scope.

Return type:

HttpRouteIntegrationConfig