An authorizer for Http Apis.
import { HttpAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2';Or use the module namespace:
import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
// apigatewayv2.HttpAuthorizerConfiguration passed to the constructor as HttpAuthorizerProps.
httpApiRequiredIHttpApiRefHTTP Api to attach the authorizer to.
identitySourceRequiredstring[]The identity source for which authorization is requested.
typeRequiredHttpAuthorizerTypeThe type of authorizer.
authorizerNameOptionalstringName of the authorizer.
Default: - id of the HttpAuthorizer construct.
authorizerUriOptionalstringThe authorizer's Uniform Resource Identifier (URI). For REQUEST authorizers, this must be a well-formed Lambda function URI.
Default: - required for Request authorizer types
enableSimpleResponsesOptionalbooleanSpecifies whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy.
Default: - The lambda authorizer must return an IAM policy as its response
jwtAudienceOptionalstring[]A list of the intended recipients of the JWT. A valid JWT must provide an aud that matches at least one entry in this list.
Default: - required for JWT authorizer typess.
jwtIssuerOptionalstringThe base domain of the identity provider that issues JWT.
Default: - required for JWT authorizer types.
payloadFormatVersionOptionalAuthorizerPayloadVersionSpecifies the format of the payload sent to an HTTP API Lambda authorizer.
Default: AuthorizerPayloadVersion.VERSION_2_0 if the authorizer type is HttpAuthorizerType.LAMBDA
resultsCacheTtlOptionalDurationHow long APIGateway should cache the results. Max 1 hour.
Default: - API Gateway will not cache authorizer responses
roleOptionalIRoleRefThe IAM role that the API Gateway service assumes while invoking the authorizer. Supported only for REQUEST authorizers.
Default: - No role
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-apigatewayv2