Interface HttpLambdaAuthorizerProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
HttpLambdaAuthorizerProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-04-02T21:55:03.992Z")
@Stability(Stable)
public interface HttpLambdaAuthorizerProps
extends software.amazon.jsii.JsiiSerializable
Properties to initialize HttpTokenAuthorizer.
Example:
import software.amazon.awscdk.aws_apigatewayv2_authorizers.HttpLambdaAuthorizer;
import software.amazon.awscdk.aws_apigatewayv2_authorizers.HttpLambdaResponseType;
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpUrlIntegration;
// This function handles your auth logic
Function authHandler;
// This role will be used to invoke the Lambda function
Role role;
HttpLambdaAuthorizer authorizer = HttpLambdaAuthorizer.Builder.create("BooksAuthorizer", authHandler)
.responseTypes(List.of(HttpLambdaResponseType.SIMPLE)) // Define if returns simple and/or iam response
.role(role)
.build();
HttpApi api = new HttpApi(this, "HttpApi");
api.addRoutes(AddRoutesOptions.builder()
.integration(new HttpUrlIntegration("BooksIntegration", "https://get-books-proxy.example.com"))
.path("/books")
.authorizer(authorizer)
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forHttpLambdaAuthorizerPropsstatic final classAn implementation forHttpLambdaAuthorizerProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default StringFriendly authorizer name.The identity source for which authorization is requested.default List<HttpLambdaResponseType> The types of responses the lambda can return.default DurationHow long APIGateway should cache the results.default IRoleRefgetRole()The IAM role that the API Gateway service assumes while invoking the authorizer.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAuthorizerName
Friendly authorizer name.Default: - same value as `id` passed in the constructor.
-
getIdentitySource
The identity source for which authorization is requested.Default: ['$request.header.Authorization']
-
getResponseTypes
The types of responses the lambda can return.If HttpLambdaResponseType.SIMPLE is included then response format 2.0 will be used.
Default: [HttpLambdaResponseType.IAM]
- See Also:
-
getResultsCacheTtl
How long APIGateway should cache the results.Max 1 hour. Disable caching by setting this to
Duration.seconds(0).Default: Duration.minutes(5)
-
getRole
The IAM role that the API Gateway service assumes while invoking the authorizer.Supported only for REQUEST authorizers.
Default: - No role
-
builder
- Returns:
- a
HttpLambdaAuthorizerProps.BuilderofHttpLambdaAuthorizerProps
-