Interface LambdaAuthorizerProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
RequestAuthorizerProps, TokenAuthorizerProps
All Known Implementing Classes:
LambdaAuthorizerProps.Jsii$Proxy, RequestAuthorizerProps.Jsii$Proxy, TokenAuthorizerProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:44.993Z") @Stability(Stable) public interface LambdaAuthorizerProps extends software.amazon.jsii.JsiiSerializable
Base properties for all lambda authorizers.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.apigateway.*;
 import software.amazon.awscdk.services.iam.*;
 import software.amazon.awscdk.services.lambda.*;
 import software.amazon.awscdk.core.*;
 Function function_;
 Role role;
 LambdaAuthorizerProps lambdaAuthorizerProps = LambdaAuthorizerProps.builder()
         .handler(function_)
         // the properties below are optional
         .assumeRole(role)
         .authorizerName("authorizerName")
         .resultsCacheTtl(Duration.minutes(30))
         .build();
 
  • Method Details

    • getHandler

      @Stability(Stable) @NotNull IFunction getHandler()
      The handler for the authorizer lambda function.

      The handler must follow a very specific protocol on the input it receives and the output it needs to produce. API Gateway has documented the handler's input specification

      invalid @link
      {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html
      | here} and output specification
      invalid @link
      {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
      | here}.
    • getAssumeRole

      @Stability(Stable) @Nullable default IRole getAssumeRole()
      An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer.

      The IAM role must be assumable by 'apigateway.amazonaws.com'.

      Default: - A resource policy is added to the Lambda function allowing apigateway.amazonaws.com to invoke the function.

    • getAuthorizerName

      @Stability(Stable) @Nullable default String getAuthorizerName()
      An optional human friendly name for the authorizer.

      Note that, this is not the primary identifier of the authorizer.

      Default: - the unique construcrt ID

    • getResultsCacheTtl

      @Stability(Stable) @Nullable default Duration getResultsCacheTtl()
      How long APIGateway should cache the results.

      Max 1 hour. Disable caching by setting this to 0.

      Default: Duration.minutes(5)

    • builder

      @Stability(Stable) static LambdaAuthorizerProps.Builder builder()
      Returns:
      a LambdaAuthorizerProps.Builder of LambdaAuthorizerProps