Class: AWSCDK::CloudFront::LambdaFunctionAssociation

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/lambda_function_association.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type:, lambda_function:, include_body: nil) ⇒ LambdaFunctionAssociation

Returns a new instance of LambdaFunctionAssociation.

Parameters:

  • event_type (AWSCDK::CloudFront::LambdaEdgeEventType)

    The lambda event type defines at which event the lambda is called during the request lifecycle.

  • lambda_function (AWSCDK::Lambda::IVersion)

    A version of the lambda to associate.

  • include_body (Boolean, nil) (defaults to: nil)

    Allows a Lambda function to have read access to the body content.



9
10
11
12
13
14
15
16
# File 'cloud_front/lambda_function_association.rb', line 9

def initialize(event_type:, lambda_function:, include_body: nil)
  @event_type = event_type
  Jsii::Type.check_type(@event_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5MYW1iZGFFZGdlRXZlbnRUeXBlIn0=")), "eventType")
  @lambda_function = lambda_function
  Jsii::Type.check_type(@lambda_function, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklWZXJzaW9uIn0=")), "lambdaFunction")
  @include_body = include_body
  Jsii::Type.check_type(@include_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "includeBody") unless @include_body.nil?
end

Instance Attribute Details

#event_typeAWSCDK::CloudFront::LambdaEdgeEventType (readonly)

The lambda event type defines at which event the lambda is called during the request lifecycle.



21
22
23
# File 'cloud_front/lambda_function_association.rb', line 21

def event_type
  @event_type
end

#include_bodyBoolean? (readonly)

Note:

Default: false

Allows a Lambda function to have read access to the body content.

Only valid for "request" event types (ORIGIN_REQUEST or VIEWER_REQUEST).



33
34
35
# File 'cloud_front/lambda_function_association.rb', line 33

def include_body
  @include_body
end

#lambda_functionAWSCDK::Lambda::IVersion (readonly)

A version of the lambda to associate.



25
26
27
# File 'cloud_front/lambda_function_association.rb', line 25

def lambda_function
  @lambda_function
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
41
# File 'cloud_front/lambda_function_association.rb', line 35

def self.jsii_properties
  {
    :event_type => "eventType",
    :lambda_function => "lambdaFunction",
    :include_body => "includeBody",
  }
end

Instance Method Details

#to_jsiiObject



43
44
45
46
47
48
49
50
51
# File 'cloud_front/lambda_function_association.rb', line 43

def to_jsii
  result = {}
  result.merge!({
    "eventType" => @event_type,
    "lambdaFunction" => @lambda_function,
    "includeBody" => @include_body,
  })
  result.compact
end