Class: AWSCDK::APIGateway::LambdaAuthorizerProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGateway::LambdaAuthorizerProps
- Defined in:
- api_gateway/lambda_authorizer_props.rb
Overview
Base properties for all lambda authorizers.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#assume_role ⇒ AWSCDK::IAM::IRole?
readonly
An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer.
-
#authorizer_name ⇒ String?
readonly
An optional human friendly name for the authorizer.
-
#handler ⇒ AWSCDK::Lambda::IFunction
readonly
The handler for the authorizer lambda function.
-
#results_cache_ttl ⇒ AWSCDK::Duration?
readonly
How long APIGateway should cache the results.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(handler:, assume_role: nil, authorizer_name: nil, results_cache_ttl: nil) ⇒ LambdaAuthorizerProps
constructor
A new instance of LambdaAuthorizerProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(handler:, assume_role: nil, authorizer_name: nil, results_cache_ttl: nil) ⇒ LambdaAuthorizerProps
Returns a new instance of LambdaAuthorizerProps.
11 12 13 14 15 16 17 18 19 20 |
# File 'api_gateway/lambda_authorizer_props.rb', line 11 def initialize(handler:, assume_role: nil, authorizer_name: nil, results_cache_ttl: nil) @handler = handler Jsii::Type.check_type(@handler, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "handler") @assume_role = assume_role Jsii::Type.check_type(@assume_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "assumeRole") unless @assume_role.nil? @authorizer_name = Jsii::Type.check_type(@authorizer_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "authorizerName") unless @authorizer_name.nil? @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? end |
Instance Attribute Details
#assume_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A resource policy is added to the Lambda function allowing apigateway.amazonaws.com to invoke the function.
An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer.
The IAM role must be assumable by 'apigateway.amazonaws.com'.
38 39 40 |
# File 'api_gateway/lambda_authorizer_props.rb', line 38 def assume_role @assume_role end |
#authorizer_name ⇒ String? (readonly)
Default: - the unique construct ID
An optional human friendly name for the authorizer.
Note that, this is not the primary identifier of the authorizer.
45 46 47 |
# File 'api_gateway/lambda_authorizer_props.rb', line 45 def @authorizer_name end |
#handler ⇒ AWSCDK::Lambda::IFunction (readonly)
The handler for the authorizer lambda function.
The handler must follow a very specific protocol on the input it receives and the output it needs to produce. API Gateway has documented the handler's input specification and output specification.
30 31 32 |
# File 'api_gateway/lambda_authorizer_props.rb', line 30 def handler @handler end |
#results_cache_ttl ⇒ AWSCDK::Duration? (readonly)
Default: - Duration.minutes(5)
How long APIGateway should cache the results.
Max 1 hour. Disable caching by setting this to 0.
53 54 55 |
# File 'api_gateway/lambda_authorizer_props.rb', line 53 def results_cache_ttl @results_cache_ttl end |
Class Method Details
.jsii_properties ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'api_gateway/lambda_authorizer_props.rb', line 55 def self.jsii_properties { :handler => "handler", :assume_role => "assumeRole", :authorizer_name => "authorizerName", :results_cache_ttl => "resultsCacheTtl", } end |
Instance Method Details
#to_jsii ⇒ Object
64 65 66 67 68 69 70 71 72 73 |
# File 'api_gateway/lambda_authorizer_props.rb', line 64 def to_jsii result = {} result.merge!({ "handler" => @handler, "assumeRole" => @assume_role, "authorizerName" => @authorizer_name, "resultsCacheTtl" => @results_cache_ttl, }) result.compact end |