Class: AWSCDK::CloudFront::ResponseCustomHeader

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

Overview

An HTTP response header name and its value.

CloudFront includes this header in HTTP responses that it sends for requests that match a cache behavior that’s associated with this response headers policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header:, override:, value:) ⇒ ResponseCustomHeader

Returns a new instance of ResponseCustomHeader.

Parameters:

  • header (String)

    The HTTP response header name.

  • override (Boolean)

    A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.

  • value (String)

    The value for the HTTP response header.



12
13
14
15
16
17
18
19
# File 'cloud_front/response_custom_header.rb', line 12

def initialize(header:, override:, value:)
  @header = header
  Jsii::Type.check_type(@header, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "header")
  @override = override
  Jsii::Type.check_type(@override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "override")
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
end

Instance Attribute Details

#headerString (readonly)

The HTTP response header name.

Returns:

  • (String)


24
25
26
# File 'cloud_front/response_custom_header.rb', line 24

def header
  @header
end

#overrideBoolean (readonly)

A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.

Returns:

  • (Boolean)


28
29
30
# File 'cloud_front/response_custom_header.rb', line 28

def override
  @override
end

#valueString (readonly)

The value for the HTTP response header.

Returns:

  • (String)


32
33
34
# File 'cloud_front/response_custom_header.rb', line 32

def value
  @value
end

Class Method Details

.jsii_propertiesObject



34
35
36
37
38
39
40
# File 'cloud_front/response_custom_header.rb', line 34

def self.jsii_properties
  {
    :header => "header",
    :override => "override",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
50
# File 'cloud_front/response_custom_header.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "header" => @header,
    "override" => @override,
    "value" => @value,
  })
  result.compact
end