LambdaAuthorizerProps

class aws_cdk.aws_apigateway.LambdaAuthorizerProps(*, handler, assume_role=None, authorizer_name=None, results_cache_ttl=None)

Bases: object

Base properties for all lambda authorizers.

Parameters

Attributes

assume_role

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.

Return type

Optional[IRole]

authorizer_name

An optional human friendly name for the authorizer.

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

Default

this.node.uniqueId

Return type

Optional[str]

handler

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 {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html | here} and output specification {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html | here}.

Return type

IFunction

results_cache_ttl

How long APIGateway should cache the results.

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

Default

Duration.minutes(5)

Return type

Optional[Duration]