Class RequestAuthorizerProps.Builder

java.lang.Object
software.amazon.awscdk.services.apigateway.RequestAuthorizerProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<RequestAuthorizerProps>
Enclosing interface:
RequestAuthorizerProps

@Stability(Stable) public static final class RequestAuthorizerProps.Builder extends Object implements software.amazon.jsii.Builder<RequestAuthorizerProps>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • identitySources

      @Stability(Stable) public RequestAuthorizerProps.Builder identitySources(List<String> identitySources)
      Parameters:
      identitySources - An array of request header mapping expressions for identities. This parameter is required. Supported parameter types are Header, Query String, Stage Variable, and Context. For instance, extracting an authorization token from a header would use the identity source IdentitySource.header('Authorizer').

      Note: API Gateway uses the specified identity sources as the request authorizer caching key. When caching is enabled, API Gateway calls the authorizer's Lambda function only after successfully verifying that all the specified identity sources are present at runtime. If a specified identify source is missing, null, or empty, API Gateway returns a 401 Unauthorized response without calling the authorizer Lambda function.

      Returns:
      this
    • handler

      @Stability(Stable) public RequestAuthorizerProps.Builder handler(IFunction handler)
      Parameters:
      handler - The handler for the authorizer lambda function. This parameter is required. 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}.
      Returns:
      this
    • assumeRole

      @Stability(Stable) public RequestAuthorizerProps.Builder assumeRole(IRole assumeRole)
      Parameters:
      assumeRole - An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer. The IAM role must be assumable by 'apigateway.amazonaws.com'.
      Returns:
      this
    • authorizerName

      @Stability(Stable) public RequestAuthorizerProps.Builder authorizerName(String authorizerName)
      Parameters:
      authorizerName - An optional human friendly name for the authorizer. Note that, this is not the primary identifier of the authorizer.
      Returns:
      this
    • resultsCacheTtl

      @Stability(Stable) public RequestAuthorizerProps.Builder resultsCacheTtl(Duration resultsCacheTtl)
      Parameters:
      resultsCacheTtl - How long APIGateway should cache the results. Max 1 hour. Disable caching by setting this to 0.
      Returns:
      this
    • build

      @Stability(Stable) public RequestAuthorizerProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<RequestAuthorizerProps>
      Returns:
      a new instance of RequestAuthorizerProps
      Throws:
      NullPointerException - if any required attribute was not provided