Class: AWSCDK::CloudFront::ResponseHeadersStrictTransportSecurity

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

Overview

Determines whether CloudFront includes the Strict-Transport-Security HTTP response header and the header’s value.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_control_max_age:, override:, include_subdomains: nil, preload: nil) ⇒ ResponseHeadersStrictTransportSecurity

Returns a new instance of ResponseHeadersStrictTransportSecurity.

Parameters:

  • access_control_max_age (AWSCDK::Duration)

    A number that CloudFront uses as the value for the max-age directive in the Strict-Transport-Security HTTP response header.

  • override (Boolean)

    A Boolean that determines whether CloudFront overrides the Strict-Transport-Security HTTP response header received from the origin with the one specified in this response headers policy.

  • include_subdomains (Boolean, nil) (defaults to: nil)

    A Boolean that determines whether CloudFront includes the includeSubDomains directive in the Strict-Transport-Security HTTP response header.

  • preload (Boolean, nil) (defaults to: nil)

    A Boolean that determines whether CloudFront includes the preload directive in the Strict-Transport-Security HTTP response header.



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

def initialize(access_control_max_age:, override:, include_subdomains: nil, preload: nil)
  @access_control_max_age = access_control_max_age
  Jsii::Type.check_type(@access_control_max_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "accessControlMaxAge")
  @override = override
  Jsii::Type.check_type(@override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "override")
  @include_subdomains = include_subdomains
  Jsii::Type.check_type(@include_subdomains, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "includeSubdomains") unless @include_subdomains.nil?
  @preload = preload
  Jsii::Type.check_type(@preload, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "preload") unless @preload.nil?
end

Instance Attribute Details

#access_control_max_ageAWSCDK::Duration (readonly)

A number that CloudFront uses as the value for the max-age directive in the Strict-Transport-Security HTTP response header.

Returns:



25
26
27
# File 'cloud_front/response_headers_strict_transport_security.rb', line 25

def access_control_max_age
  @access_control_max_age
end

#include_subdomainsBoolean? (readonly)

Note:

Default: false

A Boolean that determines whether CloudFront includes the includeSubDomains directive in the Strict-Transport-Security HTTP response header.

Returns:

  • (Boolean, nil)


34
35
36
# File 'cloud_front/response_headers_strict_transport_security.rb', line 34

def include_subdomains
  @include_subdomains
end

#overrideBoolean (readonly)

A Boolean that determines whether CloudFront overrides the Strict-Transport-Security HTTP response header received from the origin with the one specified in this response headers policy.

Returns:

  • (Boolean)


29
30
31
# File 'cloud_front/response_headers_strict_transport_security.rb', line 29

def override
  @override
end

#preloadBoolean? (readonly)

Note:

Default: false

A Boolean that determines whether CloudFront includes the preload directive in the Strict-Transport-Security HTTP response header.

Returns:

  • (Boolean, nil)


39
40
41
# File 'cloud_front/response_headers_strict_transport_security.rb', line 39

def preload
  @preload
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
48
# File 'cloud_front/response_headers_strict_transport_security.rb', line 41

def self.jsii_properties
  {
    :access_control_max_age => "accessControlMaxAge",
    :override => "override",
    :include_subdomains => "includeSubdomains",
    :preload => "preload",
  }
end

Instance Method Details

#to_jsiiObject



50
51
52
53
54
55
56
57
58
59
# File 'cloud_front/response_headers_strict_transport_security.rb', line 50

def to_jsii
  result = {}
  result.merge!({
    "accessControlMaxAge" => @access_control_max_age,
    "override" => @override,
    "includeSubdomains" => @include_subdomains,
    "preload" => @preload,
  })
  result.compact
end