Skip to content
v2.274.0

HttpRouteProps Struct ​

Properties to initialize a new Route.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';

declare const httpApiRef: apigatewayv2.IHttpApiRef;
declare const httpRouteAuthorizer: apigatewayv2.IHttpRouteAuthorizer;
declare const httpRouteIntegration: apigatewayv2.HttpRouteIntegration;
declare const httpRouteKey: apigatewayv2.HttpRouteKey;
const httpRouteProps: apigatewayv2.HttpRouteProps = {
  httpApi: httpApiRef,
  integration: httpRouteIntegration,
  routeKey: httpRouteKey,

  // the properties below are optional
  authorizationScopes: ['authorizationScopes'],
  authorizer: httpRouteAuthorizer,
};

Properties ​

authorizationScopesoptionalstring[]authorization_scopesoptionaltyping.List[str]authorizationScopesoptionalList<String>AuthorizationScopesoptionalstring[]AuthorizationScopesoptional*[]*string#
The list of OIDC scopes to include in the authorization.

Default: no additional authorization scopes

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

authorizeroptionalIHttpRouteAuthorizerauthorizeroptionalIHttpRouteAuthorizerauthorizeroptionalIHttpRouteAuthorizerAuthorizeroptionalIHttpRouteAuthorizerAuthorizeroptionalIHttpRouteAuthorizer#
Authorizer for a WebSocket API or an HTTP API.

Default: No authorizer

httpApiIHttpApiRefhttp_apiIHttpApiRefhttpApiIHttpApiRefHttpApiIHttpApiRefHttpApiIHttpApiRefrequired#
the API the route is associated with.
The integration to be configured on this route.
routeKeyHttpRouteKeyroute_keyHttpRouteKeyrouteKeyHttpRouteKeyRouteKeyHttpRouteKeyRouteKeyHttpRouteKeyrequired#
The key to this route.

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