Show / Hide Table of Contents

Class LambdaAuthorizerConfig

Configuration for Lambda authorization in AppSync.

Inheritance
object
LambdaAuthorizerConfig
Implements
ILambdaAuthorizerConfig
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LambdaAuthorizerConfig : ILambdaAuthorizerConfig
Syntax (vb)
Public Class LambdaAuthorizerConfig Implements 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

Constructors

LambdaAuthorizerConfig()

Configuration for Lambda authorization in AppSync.

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.

Constructors

LambdaAuthorizerConfig()

Configuration for Lambda authorization in AppSync.

public LambdaAuthorizerConfig()
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
                         }
                     }
                 }
             });

Properties

Handler

The authorizer lambda function.

public IFunction Handler { get; set; }
Property Value

IFunction

Remarks

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html

ResultsCacheTtl

How long the results are cached.

public Duration? ResultsCacheTtl { get; set; }
Property Value

Duration

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.

public string? ValidationRegex { get; set; }
Property Value

string

Remarks

Default: - no regex filter will be applied.

Implements

ILambdaAuthorizerConfig
Back to top Generated by DocFX