Class LambdaAuthorizerConfig.Builder
java.lang.Object
software.amazon.awscdk.services.appsync.LambdaAuthorizerConfig.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<LambdaAuthorizerConfig>
- Enclosing interface:
- LambdaAuthorizerConfig
@Stability(Experimental)
public static final class LambdaAuthorizerConfig.Builder
extends Object
implements software.amazon.jsii.Builder<LambdaAuthorizerConfig>
A builder for
LambdaAuthorizerConfig-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.Sets the value ofLambdaAuthorizerConfig.getHandler()resultsCacheTtl(Duration resultsCacheTtl) Sets the value ofLambdaAuthorizerConfig.getResultsCacheTtl()validationRegex(String validationRegex) Sets the value ofLambdaAuthorizerConfig.getValidationRegex()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
handler
Sets the value ofLambdaAuthorizerConfig.getHandler()- Parameters:
handler- The authorizer lambda function. This parameter is required. Note: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To do so with the AWS CLI, run the following:aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction- Returns:
this
-
resultsCacheTtl
@Stability(Experimental) public LambdaAuthorizerConfig.Builder resultsCacheTtl(Duration resultsCacheTtl) Sets the value ofLambdaAuthorizerConfig.getResultsCacheTtl()- Parameters:
resultsCacheTtl- How long the results are cached. Disable caching by setting this to 0.- Returns:
this
-
validationRegex
@Stability(Experimental) public LambdaAuthorizerConfig.Builder validationRegex(String validationRegex) Sets the value ofLambdaAuthorizerConfig.getValidationRegex()- Parameters:
validationRegex- A regular expression for validation of tokens before the Lambda function is called.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<LambdaAuthorizerConfig>- Returns:
- a new instance of
LambdaAuthorizerConfig - Throws:
NullPointerException- if any required attribute was not provided
-