Class: AWSCDK::Lightsail::CfnDistribution::HeaderObjectProperty

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

Overview

HeaderObject is a property of the CacheSettings property. It describes the request headers used by your distribution, which caches your content based on the request headers.

For the headers that you specify, your distribution caches separate versions of the specified content based on the header values in viewer requests. For example, suppose that viewer requests for logo.jpg contain a custom product header that has a value of either acme or apex. Also, suppose that you configure your distribution to cache your content based on values in the product header. Your distribution forwards the product header to the origin and caches the response from the origin once for each header value.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers_allow_list: nil, option: nil) ⇒ HeaderObjectProperty

Returns a new instance of HeaderObjectProperty.

Parameters:

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

    The specific headers to forward to your distribution's origin.

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

    The headers that you want your distribution to forward to your origin.



957
958
959
960
961
962
# File 'lightsail/cfn_distribution.rb', line 957

def initialize(headers_allow_list: nil, option: nil)
  @headers_allow_list = headers_allow_list
  Jsii::Type.check_type(@headers_allow_list, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "headersAllowList") unless @headers_allow_list.nil?
  @option = option
  Jsii::Type.check_type(@option, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "option") unless @option.nil?
end

Instance Attribute Details

#headers_allow_listArray<String>? (readonly)

The specific headers to forward to your distribution's origin.



968
969
970
# File 'lightsail/cfn_distribution.rb', line 968

def headers_allow_list
  @headers_allow_list
end

#optionString? (readonly)

The headers that you want your distribution to forward to your origin.

Your distribution caches your content based on these headers.

Use one of the following configurations for your distribution:

  • all - Forwards all headers to your origin..
  • none - Forwards only the default headers.
  • allow-list - Forwards only the headers that you specify using the HeadersAllowList parameter.


981
982
983
# File 'lightsail/cfn_distribution.rb', line 981

def option
  @option
end

Class Method Details

.jsii_propertiesObject



983
984
985
986
987
988
# File 'lightsail/cfn_distribution.rb', line 983

def self.jsii_properties
  {
    :headers_allow_list => "headersAllowList",
    :option => "option",
  }
end

Instance Method Details

#to_jsiiObject



990
991
992
993
994
995
996
997
# File 'lightsail/cfn_distribution.rb', line 990

def to_jsii
  result = {}
  result.merge!({
    "headersAllowList" => @headers_allow_list,
    "option" => @option,
  })
  result.compact
end