Class LambdaAuthorizerProps
Base properties for all lambda authorizers.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.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;
using Amazon.CDK.AWS.APIGateway;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.Lambda;
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
Lambda |
Properties
Assume |
An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer. |
Authorizer |
An optional human friendly name for the authorizer. |
Handler | The handler for the authorizer lambda function. |
Results |
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.
Remarks
Note that, this is not the primary identifier of the authorizer.
Default: - the unique construct 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 and output specification.
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)