Class: AWSCDK::CloudFront::CacheHeaderBehavior

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

Overview

Determines whether any HTTP headers 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) ⇒ CacheHeaderBehavior

Returns a new instance of CacheHeaderBehavior.

Raises:

  • (NoMethodError)


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

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

Class Method Details

.allow_list(*headers) ⇒ AWSCDK::CloudFront::CacheHeaderBehavior

Listed headers are included in the cache key and are automatically included in requests that CloudFront sends to the origin.

Parameters:

  • headers (Array<String>)

Returns:

  • (AWSCDK::CloudFront::CacheHeaderBehavior)


23
24
25
26
27
28
# File 'cloud_front/cache_header_behavior.rb', line 23

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

.jsii_overridable_methodsObject



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

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

.noneAWSCDK::CloudFront::CacheHeaderBehavior

HTTP headers are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin.

Returns:

  • (AWSCDK::CloudFront::CacheHeaderBehavior)


33
34
35
# File 'cloud_front/cache_header_behavior.rb', line 33

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

Instance Method Details

#behaviorString

If no headers will be passed, or an allow list of headers.

Returns:

  • (String)


40
41
42
# File 'cloud_front/cache_header_behavior.rb', line 40

def behavior()
  jsii_get_property("behavior")
end

#headersArray<String>?

The headers for the allow/deny list, if applicable.

Returns:

  • (Array<String>, nil)


47
48
49
# File 'cloud_front/cache_header_behavior.rb', line 47

def headers()
  jsii_get_property("headers")
end