Class: AWSCDK::AppSync::LambdaAuthorizerConfig
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::AppSync::LambdaAuthorizerConfig
- Defined in:
- app_sync/lambda_authorizer_config.rb
Overview
Configuration for Lambda authorization in AppSync.
Note that you can only have a single AWS Lambda function configured to authorize your API.
Instance Attribute Summary collapse
-
#handler ⇒ AWSCDK::Lambda::IFunction
readonly
The authorizer lambda function.
-
#results_cache_ttl ⇒ AWSCDK::Duration?
readonly
How long the results are cached.
-
#validation_regex ⇒ String?
readonly
A regular expression for validation of tokens before the Lambda function is called.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(handler:, results_cache_ttl: nil, validation_regex: nil) ⇒ LambdaAuthorizerConfig
constructor
A new instance of LambdaAuthorizerConfig.
- #to_jsii ⇒ Object
Constructor Details
#initialize(handler:, results_cache_ttl: nil, validation_regex: nil) ⇒ LambdaAuthorizerConfig
Returns a new instance of LambdaAuthorizerConfig.
12 13 14 15 16 17 18 19 |
# File 'app_sync/lambda_authorizer_config.rb', line 12 def initialize(handler:, results_cache_ttl: nil, validation_regex: nil) @handler = handler Jsii::Type.check_type(@handler, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "handler") @results_cache_ttl = results_cache_ttl Jsii::Type.check_type(@results_cache_ttl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "resultsCacheTtl") unless @results_cache_ttl.nil? @validation_regex = validation_regex Jsii::Type.check_type(@validation_regex, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "validationRegex") unless @validation_regex.nil? end |
Instance Attribute Details
#handler ⇒ AWSCDK::Lambda::IFunction (readonly)
The authorizer lambda function.
25 26 27 |
# File 'app_sync/lambda_authorizer_config.rb', line 25 def handler @handler end |
#results_cache_ttl ⇒ AWSCDK::Duration? (readonly)
Note:
Default: Duration.minutes(5)
How long the results are cached.
Disable caching by setting this to 0.
32 33 34 |
# File 'app_sync/lambda_authorizer_config.rb', line 32 def results_cache_ttl @results_cache_ttl end |
#validation_regex ⇒ String? (readonly)
Note:
Default: - no regex filter will be applied.
A regular expression for validation of tokens before the Lambda function is called.
37 38 39 |
# File 'app_sync/lambda_authorizer_config.rb', line 37 def validation_regex @validation_regex end |
Class Method Details
.jsii_properties ⇒ Object
39 40 41 42 43 44 45 |
# File 'app_sync/lambda_authorizer_config.rb', line 39 def self.jsii_properties { :handler => "handler", :results_cache_ttl => "resultsCacheTtl", :validation_regex => "validationRegex", } end |
Instance Method Details
#to_jsii ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'app_sync/lambda_authorizer_config.rb', line 47 def to_jsii result = {} result.merge!({ "handler" => @handler, "resultsCacheTtl" => @results_cache_ttl, "validationRegex" => @validation_regex, }) result.compact end |