Interface AppSyncLambdaAuthorizerConfig
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AppSyncLambdaAuthorizerConfig.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:09:58.874Z")
@Stability(Stable)
public interface AppSyncLambdaAuthorizerConfig
extends software.amazon.jsii.JsiiSerializable
Configuration for Lambda authorization in AppSync.
Note that you can only have a single AWS Lambda function configured to authorize your API.
Example:
import software.amazon.awscdk.services.lambda.*;
Function handler;
AppSyncAuthProvider iamProvider = AppSyncAuthProvider.builder()
.authorizationType(AppSyncAuthorizationType.IAM)
.build();
AppSyncAuthProvider apiKeyProvider = AppSyncAuthProvider.builder()
.authorizationType(AppSyncAuthorizationType.API_KEY)
.build();
AppSyncAuthProvider lambdaProvider = AppSyncAuthProvider.builder()
.authorizationType(AppSyncAuthorizationType.LAMBDA)
.lambdaAuthorizerConfig(AppSyncLambdaAuthorizerConfig.builder()
.handler(handler)
.resultsCacheTtl(Duration.minutes(6))
.validationRegex("test")
.build())
.build();
EventApi api = EventApi.Builder.create(this, "api")
.apiName("api")
.authorizationConfig(EventApiAuthConfig.builder()
// set auth providers
.authProviders(List.of(iamProvider, apiKeyProvider, lambdaProvider))
.connectionAuthModeTypes(List.of(AppSyncAuthorizationType.IAM))
.defaultPublishAuthModeTypes(List.of(AppSyncAuthorizationType.API_KEY))
.defaultSubscribeAuthModeTypes(List.of(AppSyncAuthorizationType.LAMBDA))
.build())
.build();
api.addChannelNamespace("default");
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAppSyncLambdaAuthorizerConfigstatic final classAn implementation forAppSyncLambdaAuthorizerConfig -
Method Summary
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getHandler
The authorizer lambda function.- See Also:
-
getResultsCacheTtl
How long the results are cached.Disable caching by setting this to 0.
Default: Duration.minutes(5)
-
getValidationRegex
A regular expression for validation of tokens before the Lambda function is called.Default: - no regex filter will be applied.
-
builder
-