Interface ILambdaAuthorizerConfig
Configuration for Lambda authorization in AppSync.
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ILambdaAuthorizerConfig
Syntax (vb)
Public Interface ILambdaAuthorizerConfig
Remarks
Note that you can only have a single AWS Lambda function configured to authorize your API.
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda;
Function authFunction;
new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "api",
Definition = Definition.FromFile(Join(__dirname, "appsync.test.graphql")),
AuthorizationConfig = new AuthorizationConfig {
DefaultAuthorization = new AuthorizationMode {
AuthorizationType = AuthorizationType.LAMBDA,
LambdaAuthorizerConfig = new LambdaAuthorizerConfig {
Handler = authFunction
}
}
}
});
Synopsis
Properties
Handler | The authorizer lambda function. |
ResultsCacheTtl | How long the results are cached. |
ValidationRegex | A regular expression for validation of tokens before the Lambda function is called. |
Properties
Handler
The authorizer lambda function.
IFunction Handler { get; }
Property Value
Remarks
ResultsCacheTtl
How long the results are cached.
virtual Duration ResultsCacheTtl { get; }
Property Value
Remarks
Disable caching by setting this to 0.
Default: Duration.minutes(5)
ValidationRegex
A regular expression for validation of tokens before the Lambda function is called.
virtual string ValidationRegex { get; }
Property Value
System.String
Remarks
Default: - no regex filter will be applied.