Class: AWSCDK::CloudFront::CfnCachePolicy::HeadersConfigProperty

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

Overview

An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header_behavior:, headers: nil) ⇒ HeadersConfigProperty

Returns a new instance of HeadersConfigProperty.

Parameters:

  • header_behavior (String)

    Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin.

  • headers (Array<String>, nil) (defaults to: nil)

    Contains a list of HTTP header names.



682
683
684
685
686
687
# File 'cloud_front/cfn_cache_policy.rb', line 682

def initialize(header_behavior:, headers: nil)
  @header_behavior = header_behavior
  Jsii::Type.check_type(@header_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "headerBehavior")
  @headers = headers
  Jsii::Type.check_type(@headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "headers") unless @headers.nil?
end

Instance Attribute Details

#header_behaviorString (readonly)

Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin.

Valid values are:

  • none – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to none , any headers that are listed in an OriginRequestPolicy are included in origin requests.
  • whitelist – Only the HTTP headers that are listed in the Headers type are included in the cache key and in requests that CloudFront sends to the origin.


698
699
700
# File 'cloud_front/cfn_cache_policy.rb', line 698

def header_behavior
  @header_behavior
end

#headersArray<String>? (readonly)

Contains a list of HTTP header names.



703
704
705
# File 'cloud_front/cfn_cache_policy.rb', line 703

def headers
  @headers
end

Class Method Details

.jsii_propertiesObject



705
706
707
708
709
710
# File 'cloud_front/cfn_cache_policy.rb', line 705

def self.jsii_properties
  {
    :header_behavior => "headerBehavior",
    :headers => "headers",
  }
end

Instance Method Details

#to_jsiiObject



712
713
714
715
716
717
718
719
# File 'cloud_front/cfn_cache_policy.rb', line 712

def to_jsii
  result = {}
  result.merge!({
    "headerBehavior" => @header_behavior,
    "headers" => @headers,
  })
  result.compact
end