Class WebSocketLambdaAuthorizer

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.aws_apigatewayv2_authorizers.WebSocketLambdaAuthorizer
All Implemented Interfaces:
IWebSocketRouteAuthorizer, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:52.737Z") @Stability(Stable) public class WebSocketLambdaAuthorizer extends software.amazon.jsii.JsiiObject implements IWebSocketRouteAuthorizer
Authorize WebSocket Api routes via a lambda function.

Example:

 import software.amazon.awscdk.aws_apigatewayv2_authorizers.WebSocketLambdaAuthorizer;
 import software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration;
 // This function handles your auth logic
 Function authHandler;
 // This function handles your WebSocket requests
 Function handler;
 WebSocketLambdaAuthorizer authorizer = new WebSocketLambdaAuthorizer("Authorizer", authHandler);
 WebSocketLambdaIntegration integration = new WebSocketLambdaIntegration("Integration", handler);
 WebSocketApi.Builder.create(this, "WebSocketApi")
         .connectRouteOptions(WebSocketRouteOptions.builder()
                 .integration(integration)
                 .authorizer(authorizer)
                 .build())
         .build();
 
  • Constructor Details

    • WebSocketLambdaAuthorizer

      protected WebSocketLambdaAuthorizer(software.amazon.jsii.JsiiObjectRef objRef)
    • WebSocketLambdaAuthorizer

      protected WebSocketLambdaAuthorizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • WebSocketLambdaAuthorizer

      @Stability(Stable) public WebSocketLambdaAuthorizer(@NotNull String id, @NotNull IFunction handler, @Nullable WebSocketLambdaAuthorizerProps props)
      Parameters:
      id - This parameter is required.
      handler - This parameter is required.
      props -
    • WebSocketLambdaAuthorizer

      @Stability(Stable) public WebSocketLambdaAuthorizer(@NotNull String id, @NotNull IFunction handler)
      Parameters:
      id - This parameter is required.
      handler - This parameter is required.
  • Method Details