Class: AWSCDK::CloudFront::CfnCachePolicy::QueryStringsConfigProperty

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

Overview

An object that determines whether any URL query strings in viewer requests (and if so, which query strings) 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(query_string_behavior:, query_strings: nil) ⇒ QueryStringsConfigProperty

Returns a new instance of QueryStringsConfigProperty.

Parameters:

  • query_string_behavior (String)

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

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

    Contains a list of query string names.



831
832
833
834
835
836
# File 'cloud_front/cfn_cache_policy.rb', line 831

def initialize(query_string_behavior:, query_strings: nil)
  @query_string_behavior = query_string_behavior
  Jsii::Type.check_type(@query_string_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queryStringBehavior")
  @query_strings = query_strings
  Jsii::Type.check_type(@query_strings, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "queryStrings") unless @query_strings.nil?
end

Instance Attribute Details

#query_string_behaviorString (readonly)

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

Valid values are:

  • none – No query strings 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 query strings that are listed in an OriginRequestPolicy are included in origin requests.
  • whitelist – Only the query strings in viewer requests that are listed in the QueryStringNames type are included in the cache key and in requests that CloudFront sends to the origin.
  • all_except – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin, except those that are listed in the QueryStringNames type, which are not included.
  • all – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.


849
850
851
# File 'cloud_front/cfn_cache_policy.rb', line 849

def query_string_behavior
  @query_string_behavior
end

#query_stringsArray<String>? (readonly)

Contains a list of query string names.



854
855
856
# File 'cloud_front/cfn_cache_policy.rb', line 854

def query_strings
  @query_strings
end

Class Method Details

.jsii_propertiesObject



856
857
858
859
860
861
# File 'cloud_front/cfn_cache_policy.rb', line 856

def self.jsii_properties
  {
    :query_string_behavior => "queryStringBehavior",
    :query_strings => "queryStrings",
  }
end

Instance Method Details

#to_jsiiObject



863
864
865
866
867
868
869
870
# File 'cloud_front/cfn_cache_policy.rb', line 863

def to_jsii
  result = {}
  result.merge!({
    "queryStringBehavior" => @query_string_behavior,
    "queryStrings" => @query_strings,
  })
  result.compact
end