HttpUrlIntegration

class aws_cdk.aws_apigatewayv2_integrations.HttpUrlIntegration(id, url, *, method=None, parameter_mapping=None)

Bases: aws_cdk.aws_apigatewayv2.HttpRouteIntegration

(experimental) The HTTP Proxy integration resource for HTTP API.

Stability

experimental

ExampleMetadata

infused

Example:

from aws_cdk.aws_apigatewayv2_authorizers import HttpLambdaAuthorizer, HttpLambdaResponseType
from aws_cdk.aws_apigatewayv2_integrations import HttpUrlIntegration

# This function handles your auth logic
# auth_handler: lambda.Function


authorizer = HttpLambdaAuthorizer("BooksAuthorizer", auth_handler,
    response_types=[HttpLambdaResponseType.SIMPLE]
)

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

api.add_routes(
    integration=HttpUrlIntegration("BooksIntegration", "https://get-books-proxy.myproxy.internal"),
    path="/books",
    authorizer=authorizer
)
Parameters
  • id (str) – id of the underlying integration construct.

  • url (str) – the URL to proxy to.

  • method (Optional[HttpMethod]) – (experimental) The HTTP method that must be used to invoke the underlying HTTP proxy. Default: HttpMethod.ANY

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

Stability

experimental

Methods

bind(*, route, scope)

(experimental) Bind this integration to the route.

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

  • scope (Construct) – (experimental) 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.

Stability

experimental

Return type

HttpRouteIntegrationConfig