Class LambdaAuthorizerProps
Base properties for all lambda authorizers.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.AWS.APIGateway.dll
Syntax (csharp)
public class LambdaAuthorizerProps : Object, ILambdaAuthorizerProps
Syntax (vb)
Public Class LambdaAuthorizerProps
Inherits Object
Implements ILambdaAuthorizerProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK;
Function function_;
Role role;
var lambdaAuthorizerProps = new LambdaAuthorizerProps {
Handler = function_,
// the properties below are optional
AssumeRole = role,
AuthorizerName = "authorizerName",
ResultsCacheTtl = Duration.Minutes(30)
};
Synopsis
Constructors
LambdaAuthorizerProps() |
Properties
AssumeRole | An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer. |
AuthorizerName | An optional human friendly name for the authorizer. |
Handler | The handler for the authorizer lambda function. |
ResultsCacheTtl | How long APIGateway should cache the results. |
Constructors
LambdaAuthorizerProps()
public LambdaAuthorizerProps()
Properties
AssumeRole
An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer.
public IRole AssumeRole { get; set; }
Property Value
Remarks
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.
AuthorizerName
An optional human friendly name for the authorizer.
public string AuthorizerName { get; set; }
Property Value
System.String
Remarks
Note that, this is not the primary identifier of the authorizer.
Default: - the unique construcrt ID
Handler
The handler for the authorizer lambda function.
public IFunction Handler { get; set; }
Property Value
Remarks
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}.
ResultsCacheTtl
How long APIGateway should cache the results.
public Duration ResultsCacheTtl { get; set; }
Property Value
Remarks
Max 1 hour. Disable caching by setting this to 0.
Default: Duration.minutes(5)