HttpRouteProps

class aws_cdk.aws_apigatewayv2.HttpRouteProps(*, integration, http_api, route_key, authorization_scopes=None, authorizer=None)

Bases: BatchHttpRouteOptions

Properties to initialize a new Route.

Parameters:
  • integration (HttpRouteIntegration) – The integration to be configured on this route.

  • http_api (IHttpApi) – the API the route is associated with.

  • route_key (HttpRouteKey) – The key to this route. This is a combination of an HTTP method and an HTTP path.

  • authorization_scopes (Optional[Sequence[str]]) – The list of OIDC scopes to include in the authorization. These scopes will be merged with the scopes from the attached authorizer Default: - no additional authorization scopes

  • authorizer (Optional[IHttpRouteAuthorizer]) – Authorizer for a WebSocket API or an HTTP API. Default: - No authorizer

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigatewayv2 as apigatewayv2

# http_api: apigatewayv2.HttpApi
# http_route_authorizer: apigatewayv2.IHttpRouteAuthorizer
# http_route_integration: apigatewayv2.HttpRouteIntegration
# http_route_key: apigatewayv2.HttpRouteKey

http_route_props = apigatewayv2.HttpRouteProps(
    http_api=http_api,
    integration=http_route_integration,
    route_key=http_route_key,

    # the properties below are optional
    authorization_scopes=["authorizationScopes"],
    authorizer=http_route_authorizer
)

Attributes

authorization_scopes

The list of OIDC scopes to include in the authorization.

These scopes will be merged with the scopes from the attached authorizer

Default:
  • no additional authorization scopes

authorizer

Authorizer for a WebSocket API or an HTTP API.

Default:
  • No authorizer

http_api

the API the route is associated with.

integration

The integration to be configured on this route.

route_key

The key to this route.

This is a combination of an HTTP method and an HTTP path.