Class: AWSCDK::CloudFront::CfnDistribution::FunctionAssociationProperty

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

Overview

A CloudFront function that is associated with a cache behavior in a CloudFront distribution.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type: nil, function_arn: nil) ⇒ FunctionAssociationProperty

Returns a new instance of FunctionAssociationProperty.

Parameters:

  • event_type (String, nil) (defaults to: nil)

    The event type of the function, either viewer-request or viewer-response .

  • function_arn (String, nil) (defaults to: nil)

    The Amazon Resource Name (ARN) of the function.



2103
2104
2105
2106
2107
2108
# File 'cloud_front/cfn_distribution.rb', line 2103

def initialize(event_type: nil, function_arn: nil)
  @event_type = event_type
  Jsii::Type.check_type(@event_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "eventType") unless @event_type.nil?
  @function_arn = function_arn
  Jsii::Type.check_type(@function_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "functionArn") unless @function_arn.nil?
end

Instance Attribute Details

#event_typeString? (readonly)

The event type of the function, either viewer-request or viewer-response .

You cannot use origin-facing event types ( origin-request and origin-response ) with a CloudFront function.



2116
2117
2118
# File 'cloud_front/cfn_distribution.rb', line 2116

def event_type
  @event_type
end

#function_arnString? (readonly)

The Amazon Resource Name (ARN) of the function.



2121
2122
2123
# File 'cloud_front/cfn_distribution.rb', line 2121

def function_arn
  @function_arn
end

Class Method Details

.jsii_propertiesObject



2123
2124
2125
2126
2127
2128
# File 'cloud_front/cfn_distribution.rb', line 2123

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

Instance Method Details

#to_jsiiObject



2130
2131
2132
2133
2134
2135
2136
2137
# File 'cloud_front/cfn_distribution.rb', line 2130

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