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

interface HttpLambdaAuthorizerProps ๐Ÿ”น

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

Properties to initialize HttpTokenAuthorizer.

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,
});

Properties

NameTypeDescription
authorizerName?๐Ÿ”นstringFriendly authorizer name.
identitySource?๐Ÿ”นstring[]The identity source for which authorization is requested.
responseTypes?๐Ÿ”นHttpLambdaResponseType[]The types of responses the lambda can return.
resultsCacheTtl?๐Ÿ”นDurationHow long APIGateway should cache the results.

authorizerName?๐Ÿ”น

Type: string (optional, default: same value as id passed in the constructor.)

Friendly authorizer name.


identitySource?๐Ÿ”น

Type: string[] (optional, default: ['$request.header.Authorization'])

The identity source for which authorization is requested.


responseTypes?๐Ÿ”น

Type: HttpLambdaResponseType[] (optional, default: [HttpLambdaResponseType.IAM])

The types of responses the lambda can return.

If HttpLambdaResponseType.SIMPLE is included then response format 2.0 will be used.

See also: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.payload-format-response


resultsCacheTtl?๐Ÿ”น

Type: Duration (optional, default: Duration.minutes(5))

How long APIGateway should cache the results.

Max 1 hour. Disable caching by setting this to Duration.seconds(0).