Class: AWSCDK::CloudFront::FunctionAssociation

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

Overview

Represents a CloudFront function and event type when using CF Functions.

The type of the AddBehaviorOptions.functionAssociations property.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type:, function:) ⇒ FunctionAssociation

Returns a new instance of FunctionAssociation.

Parameters:



11
12
13
14
15
16
# File 'cloud_front/function_association.rb', line 11

def initialize(event_type:, function:)
  @event_type = event_type
  Jsii::Type.check_type(@event_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5GdW5jdGlvbkV2ZW50VHlwZSJ9")), "eventType")
  @function = function
  Jsii::Type.check_type(@function, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jbG91ZGZyb250LklGdW5jdGlvblJlZiJ9")), "function")
end

Instance Attribute Details

#event_typeAWSCDK::CloudFront::FunctionEventType (readonly)

The type of event which should invoke the function.



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

def event_type
  @event_type
end

#functionAWSCDK::Interfaces::AWSCloudfront::IFunctionRef (readonly)

The CloudFront function that will be invoked.



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

def function
  @function
end

Class Method Details

.jsii_propertiesObject



27
28
29
30
31
32
# File 'cloud_front/function_association.rb', line 27

def self.jsii_properties
  {
    :event_type => "eventType",
    :function => "function",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!({
    "eventType" => @event_type,
    "function" => @function,
  })
  result.compact
end