Class: AWSCDK::CloudFront::CfnCachePolicy::CookiesConfigProperty

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

Overview

An object that determines whether any cookies in viewer requests (and if so, which cookies) 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(cookie_behavior:, cookies: nil) ⇒ CookiesConfigProperty

Returns a new instance of CookiesConfigProperty.

Parameters:

  • cookie_behavior (String)

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

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

    Contains a list of cookie names.



632
633
634
635
636
637
# File 'cloud_front/cfn_cache_policy.rb', line 632

def initialize(cookie_behavior:, cookies: nil)
  @cookie_behavior = cookie_behavior
  Jsii::Type.check_type(@cookie_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cookieBehavior")
  @cookies = cookies
  Jsii::Type.check_type(@cookies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "cookies") unless @cookies.nil?
end

Instance Attribute Details

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

Valid values are:

  • none – No cookies in viewer requests are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to none , any cookies that are listed in an OriginRequestPolicy are included in origin requests.
  • whitelist – Only the cookies in viewer requests that are listed in the CookieNames type are included in the cache key and in requests that CloudFront sends to the origin.
  • all_except – All cookies in viewer requests are included in the cache key and in requests that CloudFront sends to the origin, except for those that are listed in the CookieNames type, which are not included.
  • all – All cookies in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.


650
651
652
# File 'cloud_front/cfn_cache_policy.rb', line 650

def cookie_behavior
  @cookie_behavior
end

#cookiesArray<String>? (readonly)

Contains a list of cookie names.



655
656
657
# File 'cloud_front/cfn_cache_policy.rb', line 655

def cookies
  @cookies
end

Class Method Details

.jsii_propertiesObject



657
658
659
660
661
662
# File 'cloud_front/cfn_cache_policy.rb', line 657

def self.jsii_properties
  {
    :cookie_behavior => "cookieBehavior",
    :cookies => "cookies",
  }
end

Instance Method Details

#to_jsiiObject



664
665
666
667
668
669
670
671
# File 'cloud_front/cfn_cache_policy.rb', line 664

def to_jsii
  result = {}
  result.merge!({
    "cookieBehavior" => @cookie_behavior,
    "cookies" => @cookies,
  })
  result.compact
end