HttpProxyIntegrationProps

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

Bases: object

(experimental) Properties to initialize a new HttpProxyIntegration.

Parameters
  • url (str) – (experimental) The full-qualified HTTP URL for the HTTP integration.

  • 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

Example:

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

# This function handles your auth logic
# auth_handler is of type Function


authorizer = HttpLambdaAuthorizer(
    authorizer_name="lambda-authorizer",
    response_types=[HttpLambdaResponseType.SIMPLE],  # Define if returns simple and/or iam response
    handler=auth_handler
)

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

api.add_routes(
    integration=HttpProxyIntegration(
        url="https://get-books-proxy.myproxy.internal"
    ),
    path="/books",
    authorizer=authorizer
)

Attributes

method

(experimental) The HTTP method that must be used to invoke the underlying HTTP proxy.

Default

HttpMethod.ANY

Stability

experimental

Return type

Optional[HttpMethod]

parameter_mapping

(experimental) Specifies how to transform HTTP requests before sending them to the backend.

Default

undefined requests are sent to the backend unmodified

See

https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html

Stability

experimental

Return type

Optional[ParameterMapping]

url

(experimental) The full-qualified HTTP URL for the HTTP integration.

Stability

experimental

Return type

str