@aws-cdk_aws-apigatewayv2-authorizers-alpha.HttpLambdaAuthorizer

class HttpLambdaAuthorizer ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Authorizers.Alpha.HttpLambdaAuthorizer
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2authorizersalpha/v2#HttpLambdaAuthorizer
Javasoftware.amazon.awscdk.services.apigatewayv2.authorizers.alpha.HttpLambdaAuthorizer
Pythonaws_cdk.aws_apigatewayv2_authorizers_alpha.HttpLambdaAuthorizer
TypeScript (source)@aws-cdk/aws-apigatewayv2-authorizers-alpha ยป HttpLambdaAuthorizer

Implements IHttpRouteAuthorizer

Authorize Http Api routes via a lambda function.

Example

import { HttpLambdaAuthorizer, HttpLambdaResponseType } from '@aws-cdk/aws-apigatewayv2-authorizers-alpha';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

// This function handles your auth logic
declare const authHandler: lambda.Function;

const authorizer = new HttpLambdaAuthorizer('BooksAuthorizer', authHandler, {
  responseTypes: [HttpLambdaResponseType.SIMPLE], // Define if returns simple and/or iam response
});

const api = new apigwv2.HttpApi(this, 'HttpApi');

api.addRoutes({
  integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.example.com'),
  path: '/books',
  authorizer,
});

Initializer

new HttpLambdaAuthorizer(id: string, handler: IFunction, props?: HttpLambdaAuthorizerProps)

Parameters

  • id string โ€” The id of the underlying construct.
  • handler IFunction
  • props HttpLambdaAuthorizerProps โ€” Properties to configure the authorizer.

Initialize a lambda authorizer to be bound with HTTP route.

Methods

NameDescription
bind(options)๐Ÿ”นBind this authorizer to a specified Http route.

bind(options)๐Ÿ”น

public bind(options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig

Parameters

  • options HttpRouteAuthorizerBindOptions

Returns

  • HttpRouteAuthorizerConfig

Bind this authorizer to a specified Http route.