Class: AWSCDK::CloudFront::CfnResponseHeadersPolicy::StrictTransportSecurityProperty

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

Overview

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

For more information about the Strict-Transport-Security HTTP response header, see Strict-Transport-Security in the MDN Web Docs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_control_max_age_sec:, override:, include_subdomains: nil, preload: nil) ⇒ StrictTransportSecurityProperty

Returns a new instance of StrictTransportSecurityProperty.

Parameters:

  • access_control_max_age_sec (Numeric)

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

  • override (Boolean, AWSCDK::IResolvable)

    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, AWSCDK::IResolvable, nil) (defaults to: nil)

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

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

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



1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'cloud_front/cfn_response_headers_policy.rb', line 1375

def initialize(access_control_max_age_sec:, override:, include_subdomains: nil, preload: nil)
  @access_control_max_age_sec = access_control_max_age_sec
  Jsii::Type.check_type(@access_control_max_age_sec, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "accessControlMaxAgeSec")
  @override = override
  Jsii::Type.check_type(@override, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "override")
  @include_subdomains = include_subdomains
  Jsii::Type.check_type(@include_subdomains, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "includeSubdomains") unless @include_subdomains.nil?
  @preload = preload
  Jsii::Type.check_type(@preload, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "preload") unless @preload.nil?
end

Instance Attribute Details

#access_control_max_age_secNumeric (readonly)

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



1390
1391
1392
# File 'cloud_front/cfn_response_headers_policy.rb', line 1390

def access_control_max_age_sec
  @access_control_max_age_sec
end

#include_subdomainsBoolean, ... (readonly)

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



1400
1401
1402
# File 'cloud_front/cfn_response_headers_policy.rb', line 1400

def include_subdomains
  @include_subdomains
end

#overrideBoolean, AWSCDK::IResolvable (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.



1395
1396
1397
# File 'cloud_front/cfn_response_headers_policy.rb', line 1395

def override
  @override
end

#preloadBoolean, ... (readonly)

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



1405
1406
1407
# File 'cloud_front/cfn_response_headers_policy.rb', line 1405

def preload
  @preload
end

Class Method Details

.jsii_propertiesObject



1407
1408
1409
1410
1411
1412
1413
1414
# File 'cloud_front/cfn_response_headers_policy.rb', line 1407

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

Instance Method Details

#to_jsiiObject



1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
# File 'cloud_front/cfn_response_headers_policy.rb', line 1416

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