Class: AWSCDK::CloudFront::CacheQueryStringBehavior

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

Overview

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CacheQueryStringBehavior

Returns a new instance of CacheQueryStringBehavior.

Raises:

  • (NoMethodError)


8
9
10
# File 'cloud_front/cache_query_string_behavior.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.allAWSCDK::CloudFront::CacheQueryStringBehavior

All query strings in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin.

Returns:

  • (AWSCDK::CloudFront::CacheQueryStringBehavior)


22
23
24
# File 'cloud_front/cache_query_string_behavior.rb', line 22

def self.all()
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "all", [])
end

.allow_list(*query_strings) ⇒ AWSCDK::CloudFront::CacheQueryStringBehavior

Only the provided queryStrings are included in the cache key and automatically included in requests that CloudFront sends to the origin.

Parameters:

  • query_strings (Array<String>)

Returns:

  • (AWSCDK::CloudFront::CacheQueryStringBehavior)


30
31
32
33
34
35
# File 'cloud_front/cache_query_string_behavior.rb', line 30

def self.allow_list(*query_strings)
  query_strings.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queryStrings[#{index}]")
  end
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "allowList", [*query_strings])
end

.deny_list(*query_strings) ⇒ AWSCDK::CloudFront::CacheQueryStringBehavior

All query strings except the provided queryStrings are included in the cache key and automatically included in requests that CloudFront sends to the origin.

Parameters:

  • query_strings (Array<String>)

Returns:

  • (AWSCDK::CloudFront::CacheQueryStringBehavior)


41
42
43
44
45
46
# File 'cloud_front/cache_query_string_behavior.rb', line 41

def self.deny_list(*query_strings)
  query_strings.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queryStrings[#{index}]")
  end
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "denyList", [*query_strings])
end

.jsii_overridable_methodsObject



12
13
14
15
16
17
# File 'cloud_front/cache_query_string_behavior.rb', line 12

def self.jsii_overridable_methods
  {
    :behavior => { kind: :property, name: "behavior", is_optional: false },
    :query_strings => { kind: :property, name: "queryStrings", is_optional: true },
  }
end

.noneAWSCDK::CloudFront::CacheQueryStringBehavior

Query strings in viewer requests are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin.

Returns:

  • (AWSCDK::CloudFront::CacheQueryStringBehavior)


51
52
53
# File 'cloud_front/cache_query_string_behavior.rb', line 51

def self.none()
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.CacheQueryStringBehavior", "none", [])
end

Instance Method Details

#behaviorString

The behavior of query strings -- allow all, none, only an allow list, or a deny list.

Returns:

  • (String)


58
59
60
# File 'cloud_front/cache_query_string_behavior.rb', line 58

def behavior()
  jsii_get_property("behavior")
end

#query_stringsArray<String>?

The query strings to allow or deny, if the behavior is an allow or deny list.

Returns:

  • (Array<String>, nil)


65
66
67
# File 'cloud_front/cache_query_string_behavior.rb', line 65

def query_strings()
  jsii_get_property("queryStrings")
end