Class: AWSCDK::CloudFront::CfnOriginRequestPolicy::HeadersConfigProperty

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

Overview

An object that determines whether any HTTP headers (and if so, which headers) are included 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 requests that CloudFront sends to the origin. Valid values are:.

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

    Contains a list of HTTP header names.



575
576
577
578
579
580
# File 'cloud_front/cfn_origin_request_policy.rb', line 575

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 requests that CloudFront sends to the origin. Valid values are:.

  • none – No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set to none , any headers that are listed in a CachePolicy are included in origin requests.
  • whitelist – Only the HTTP headers that are listed in the Headers type are included in requests that CloudFront sends to the origin.
  • all_viewer – All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.
  • all_viewer_and_whitelist_cloud_front – All HTTP headers in viewer requests and the additional CloudFront headers that are listed in the Headers type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.
  • all_except – All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in the Headers type, which are not included.


592
593
594
# File 'cloud_front/cfn_origin_request_policy.rb', line 592

def header_behavior
  @header_behavior
end

#headersArray<String>? (readonly)

Contains a list of HTTP header names.



597
598
599
# File 'cloud_front/cfn_origin_request_policy.rb', line 597

def headers
  @headers
end

Class Method Details

.jsii_propertiesObject



599
600
601
602
603
604
# File 'cloud_front/cfn_origin_request_policy.rb', line 599

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

Instance Method Details

#to_jsiiObject



606
607
608
609
610
611
612
613
# File 'cloud_front/cfn_origin_request_policy.rb', line 606

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