Interface ILambdaAuthorizerProps
Base properties for all lambda authorizers.
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ILambdaAuthorizerProps
Syntax (vb)
Public Interface 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
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. |
Properties
AssumeRole
An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer.
virtual IRole AssumeRole { get; }
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.
virtual string AuthorizerName { get; }
Property Value
System.String
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.
IFunction Handler { get; }
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.
virtual Duration ResultsCacheTtl { get; }
Property Value
Remarks
Max 1 hour. Disable caching by setting this to 0.
Default: Duration.minutes(5)