CfnResponseHeadersPolicyPropsMixin

class aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnResponseHeadersPolicyPropsMixin(props, *, strategy=None)

Bases: Mixin

A response headers policy.

A response headers policy contains information about a set of HTTP response headers.

After you create a response headers policy, you can use its ID to attach it to one or more cache behaviors in a CloudFront distribution. When it’s attached to a cache behavior, the response headers policy affects the HTTP headers that CloudFront includes in HTTP responses to requests that match the cache behavior. CloudFront adds or removes response headers according to the configuration of the response headers policy.

For more information, see Adding or removing HTTP headers in CloudFront responses in the Amazon CloudFront Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-responseheaderspolicy.html

CloudformationResource:

AWS::CloudFront::ResponseHeadersPolicy

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

cfn_response_headers_policy_props_mixin = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin(cloudfront_mixins.CfnResponseHeadersPolicyMixinProps(
    response_headers_policy_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ResponseHeadersPolicyConfigProperty(
        comment="comment",
        cors_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CorsConfigProperty(
            access_control_allow_credentials=False,
            access_control_allow_headers=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowHeadersProperty(
                items=["items"]
            ),
            access_control_allow_methods=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowMethodsProperty(
                items=["items"]
            ),
            access_control_allow_origins=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowOriginsProperty(
                items=["items"]
            ),
            access_control_expose_headers=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlExposeHeadersProperty(
                items=["items"]
            ),
            access_control_max_age_sec=123,
            origin_override=False
        ),
        custom_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CustomHeadersConfigProperty(
            items=[cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CustomHeaderProperty(
                header="header",
                override=False,
                value="value"
            )]
        ),
        name="name",
        remove_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.RemoveHeadersConfigProperty(
            items=[cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.RemoveHeaderProperty(
                header="header"
            )]
        ),
        security_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.SecurityHeadersConfigProperty(
            content_security_policy=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentSecurityPolicyProperty(
                content_security_policy="contentSecurityPolicy",
                override=False
            ),
            content_type_options=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentTypeOptionsProperty(
                override=False
            ),
            frame_options=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.FrameOptionsProperty(
                frame_option="frameOption",
                override=False
            ),
            referrer_policy=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ReferrerPolicyProperty(
                override=False,
                referrer_policy="referrerPolicy"
            ),
            strict_transport_security=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.StrictTransportSecurityProperty(
                access_control_max_age_sec=123,
                include_subdomains=False,
                override=False,
                preload=False
            ),
            xss_protection=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.XSSProtectionProperty(
                mode_block=False,
                override=False,
                protection=False,
                report_uri="reportUri"
            )
        ),
        server_timing_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ServerTimingHeadersConfigProperty(
            enabled=False,
            sampling_rate=123
        )
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::CloudFront::ResponseHeadersPolicy.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['responseHeadersPolicyConfig']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

AccessControlAllowHeadersProperty

class CfnResponseHeadersPolicyPropsMixin.AccessControlAllowHeadersProperty(*, items=None)

Bases: object

A list of HTTP header names that CloudFront includes as values for the Access-Control-Allow-Headers HTTP response header.

For more information about the Access-Control-Allow-Headers HTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.

Parameters:

items (Optional[Sequence[str]]) – The list of HTTP header names. You can specify * to allow all headers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowheaders.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

access_control_allow_headers_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowHeadersProperty(
    items=["items"]
)

Attributes

items

The list of HTTP header names.

You can specify * to allow all headers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowheaders.html#cfn-cloudfront-responseheaderspolicy-accesscontrolallowheaders-items

AccessControlAllowMethodsProperty

class CfnResponseHeadersPolicyPropsMixin.AccessControlAllowMethodsProperty(*, items=None)

Bases: object

A list of HTTP methods that CloudFront includes as values for the Access-Control-Allow-Methods HTTP response header.

For more information about the Access-Control-Allow-Methods HTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.

Parameters:

items (Optional[Sequence[str]]) – The list of HTTP methods. Valid values are:. - GET - DELETE - HEAD - OPTIONS - PATCH - POST - PUT - ALL ALL is a special value that includes all of the listed HTTP methods.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowmethods.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

access_control_allow_methods_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowMethodsProperty(
    items=["items"]
)

Attributes

items

.

  • GET

  • DELETE

  • HEAD

  • OPTIONS

  • PATCH

  • POST

  • PUT

  • ALL

ALL is a special value that includes all of the listed HTTP methods.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowmethods.html#cfn-cloudfront-responseheaderspolicy-accesscontrolallowmethods-items

Type:

The list of HTTP methods. Valid values are

AccessControlAllowOriginsProperty

class CfnResponseHeadersPolicyPropsMixin.AccessControlAllowOriginsProperty(*, items=None)

Bases: object

A list of origins (domain names) that CloudFront can use as the value for the Access-Control-Allow-Origin HTTP response header.

For more information about the Access-Control-Allow-Origin HTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.

Parameters:

items (Optional[Sequence[str]]) – The list of origins (domain names). You can specify * to allow all origins.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolalloworigins.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

access_control_allow_origins_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowOriginsProperty(
    items=["items"]
)

Attributes

items

The list of origins (domain names).

You can specify * to allow all origins.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolalloworigins.html#cfn-cloudfront-responseheaderspolicy-accesscontrolalloworigins-items

AccessControlExposeHeadersProperty

class CfnResponseHeadersPolicyPropsMixin.AccessControlExposeHeadersProperty(*, items=None)

Bases: object

A list of HTTP headers that CloudFront includes as values for the Access-Control-Expose-Headers HTTP response header.

For more information about the Access-Control-Expose-Headers HTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.

Parameters:

items (Optional[Sequence[str]]) – The list of HTTP headers. You can specify * to expose all headers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolexposeheaders.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

access_control_expose_headers_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlExposeHeadersProperty(
    items=["items"]
)

Attributes

items

The list of HTTP headers.

You can specify * to expose all headers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolexposeheaders.html#cfn-cloudfront-responseheaderspolicy-accesscontrolexposeheaders-items

ContentSecurityPolicyProperty

class CfnResponseHeadersPolicyPropsMixin.ContentSecurityPolicyProperty(*, content_security_policy=None, override=None)

Bases: object

The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

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

Parameters:
  • content_security_policy (Optional[str]) – The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

  • override (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront overrides the Content-Security-Policy HTTP response header received from the origin with the one specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contentsecuritypolicy.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

content_security_policy_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentSecurityPolicyProperty(
    content_security_policy="contentSecurityPolicy",
    override=False
)

Attributes

content_security_policy

The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contentsecuritypolicy.html#cfn-cloudfront-responseheaderspolicy-contentsecuritypolicy-contentsecuritypolicy

override

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contentsecuritypolicy.html#cfn-cloudfront-responseheaderspolicy-contentsecuritypolicy-override

ContentTypeOptionsProperty

class CfnResponseHeadersPolicyPropsMixin.ContentTypeOptionsProperty(*, override=None)

Bases: object

Determines whether CloudFront includes the X-Content-Type-Options HTTP response header with its value set to nosniff .

For more information about the X-Content-Type-Options HTTP response header, see X-Content-Type-Options in the MDN Web Docs.

Parameters:

override (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront overrides the X-Content-Type-Options HTTP response header received from the origin with the one specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contenttypeoptions.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

content_type_options_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentTypeOptionsProperty(
    override=False
)

Attributes

override

A Boolean that determines whether CloudFront overrides the X-Content-Type-Options HTTP response header received from the origin with the one specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contenttypeoptions.html#cfn-cloudfront-responseheaderspolicy-contenttypeoptions-override

CorsConfigProperty

class CfnResponseHeadersPolicyPropsMixin.CorsConfigProperty(*, access_control_allow_credentials=None, access_control_allow_headers=None, access_control_allow_methods=None, access_control_allow_origins=None, access_control_expose_headers=None, access_control_max_age_sec=None, origin_override=None)

Bases: object

A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).

CloudFront adds these headers to HTTP responses that it sends for CORS requests that match a cache behavior associated with this response headers policy.

For more information about CORS, see Cross-Origin Resource Sharing (CORS) in the MDN Web Docs.

Parameters:
  • access_control_allow_credentials (Union[bool, IResolvable, None]) – A Boolean that CloudFront uses as the value for the Access-Control-Allow-Credentials HTTP response header. For more information about the Access-Control-Allow-Credentials HTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.

  • access_control_allow_headers (Union[IResolvable, AccessControlAllowHeadersProperty, Dict[str, Any], None]) –

    A list of HTTP header names that CloudFront includes as values for the Access-Control-Allow-Headers HTTP response header. For more information about the Access-Control-Allow-Headers HTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.

  • access_control_allow_methods (Union[IResolvable, AccessControlAllowMethodsProperty, Dict[str, Any], None]) –

    A list of HTTP methods that CloudFront includes as values for the Access-Control-Allow-Methods HTTP response header. For more information about the Access-Control-Allow-Methods HTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.

  • access_control_allow_origins (Union[IResolvable, AccessControlAllowOriginsProperty, Dict[str, Any], None]) –

    A list of origins (domain names) that CloudFront can use as the value for the Access-Control-Allow-Origin HTTP response header. For more information about the Access-Control-Allow-Origin HTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.

  • access_control_expose_headers (Union[IResolvable, AccessControlExposeHeadersProperty, Dict[str, Any], None]) –

    A list of HTTP headers that CloudFront includes as values for the Access-Control-Expose-Headers HTTP response header. For more information about the Access-Control-Expose-Headers HTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.

  • access_control_max_age_sec (Union[int, float, None]) – A number that CloudFront uses as the value for the Access-Control-Max-Age HTTP response header. For more information about the Access-Control-Max-Age HTTP response header, see Access-Control-Max-Age in the MDN Web Docs.

  • origin_override (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

cors_config_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CorsConfigProperty(
    access_control_allow_credentials=False,
    access_control_allow_headers=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowHeadersProperty(
        items=["items"]
    ),
    access_control_allow_methods=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowMethodsProperty(
        items=["items"]
    ),
    access_control_allow_origins=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowOriginsProperty(
        items=["items"]
    ),
    access_control_expose_headers=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlExposeHeadersProperty(
        items=["items"]
    ),
    access_control_max_age_sec=123,
    origin_override=False
)

Attributes

access_control_allow_credentials

A Boolean that CloudFront uses as the value for the Access-Control-Allow-Credentials HTTP response header.

For more information about the Access-Control-Allow-Credentials HTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolallowcredentials

access_control_allow_headers

A list of HTTP header names that CloudFront includes as values for the Access-Control-Allow-Headers HTTP response header.

For more information about the Access-Control-Allow-Headers HTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolallowheaders

access_control_allow_methods

A list of HTTP methods that CloudFront includes as values for the Access-Control-Allow-Methods HTTP response header.

For more information about the Access-Control-Allow-Methods HTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolallowmethods

access_control_allow_origins

A list of origins (domain names) that CloudFront can use as the value for the Access-Control-Allow-Origin HTTP response header.

For more information about the Access-Control-Allow-Origin HTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolalloworigins

access_control_expose_headers

A list of HTTP headers that CloudFront includes as values for the Access-Control-Expose-Headers HTTP response header.

For more information about the Access-Control-Expose-Headers HTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolexposeheaders

access_control_max_age_sec

A number that CloudFront uses as the value for the Access-Control-Max-Age HTTP response header.

For more information about the Access-Control-Max-Age HTTP response header, see Access-Control-Max-Age in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolmaxagesec

origin_override

A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-originoverride

CustomHeaderProperty

class CfnResponseHeadersPolicyPropsMixin.CustomHeaderProperty(*, header=None, override=None, value=None)

Bases: object

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.

Parameters:
  • header (Optional[str]) – The HTTP response header name.

  • override (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.

  • value (Optional[str]) – The value for the HTTP response header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

custom_header_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CustomHeaderProperty(
    header="header",
    override=False,
    value="value"
)

Attributes

header

The HTTP response header name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html#cfn-cloudfront-responseheaderspolicy-customheader-header

override

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html#cfn-cloudfront-responseheaderspolicy-customheader-override

value

The value for the HTTP response header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html#cfn-cloudfront-responseheaderspolicy-customheader-value

CustomHeadersConfigProperty

class CfnResponseHeadersPolicyPropsMixin.CustomHeadersConfigProperty(*, items=None)

Bases: object

A list of HTTP response header names and their values.

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

Parameters:

items (Union[IResolvable, Sequence[Union[IResolvable, CustomHeaderProperty, Dict[str, Any]]], None]) – The list of HTTP response headers and their values.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheadersconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

custom_headers_config_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CustomHeadersConfigProperty(
    items=[cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CustomHeaderProperty(
        header="header",
        override=False,
        value="value"
    )]
)

Attributes

items

The list of HTTP response headers and their values.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheadersconfig.html#cfn-cloudfront-responseheaderspolicy-customheadersconfig-items

FrameOptionsProperty

class CfnResponseHeadersPolicyPropsMixin.FrameOptionsProperty(*, frame_option=None, override=None)

Bases: object

Determines whether CloudFront includes the X-Frame-Options HTTP response header and the header’s value.

For more information about the X-Frame-Options HTTP response header, see X-Frame-Options in the MDN Web Docs.

Parameters:
  • frame_option (Optional[str]) –

    The value of the X-Frame-Options HTTP response header. Valid values are DENY and SAMEORIGIN . For more information about these values, see X-Frame-Options in the MDN Web Docs.

  • override (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront overrides the X-Frame-Options HTTP response header received from the origin with the one specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-frameoptions.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

frame_options_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.FrameOptionsProperty(
    frame_option="frameOption",
    override=False
)

Attributes

frame_option

The value of the X-Frame-Options HTTP response header. Valid values are DENY and SAMEORIGIN .

For more information about these values, see X-Frame-Options in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-frameoptions.html#cfn-cloudfront-responseheaderspolicy-frameoptions-frameoption

override

A Boolean that determines whether CloudFront overrides the X-Frame-Options HTTP response header received from the origin with the one specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-frameoptions.html#cfn-cloudfront-responseheaderspolicy-frameoptions-override

ReferrerPolicyProperty

class CfnResponseHeadersPolicyPropsMixin.ReferrerPolicyProperty(*, override=None, referrer_policy=None)

Bases: object

Determines whether CloudFront includes the Referrer-Policy HTTP response header and the header’s value.

For more information about the Referrer-Policy HTTP response header, see Referrer-Policy in the MDN Web Docs.

Parameters:
  • override (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront overrides the Referrer-Policy HTTP response header received from the origin with the one specified in this response headers policy.

  • referrer_policy (Optional[str]) –

    The value of the Referrer-Policy HTTP response header. Valid values are:. - no-referrer - no-referrer-when-downgrade - origin - origin-when-cross-origin - same-origin - strict-origin - strict-origin-when-cross-origin - unsafe-url For more information about these values, see Referrer-Policy in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-referrerpolicy.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

referrer_policy_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ReferrerPolicyProperty(
    override=False,
    referrer_policy="referrerPolicy"
)

Attributes

override

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-referrerpolicy.html#cfn-cloudfront-responseheaderspolicy-referrerpolicy-override

referrer_policy

.

  • no-referrer

  • no-referrer-when-downgrade

  • origin

  • origin-when-cross-origin

  • same-origin

  • strict-origin

  • strict-origin-when-cross-origin

  • unsafe-url

For more information about these values, see Referrer-Policy in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-referrerpolicy.html#cfn-cloudfront-responseheaderspolicy-referrerpolicy-referrerpolicy

Type:

The value of the Referrer-Policy HTTP response header. Valid values are

RemoveHeaderProperty

class CfnResponseHeadersPolicyPropsMixin.RemoveHeaderProperty(*, header=None)

Bases: object

The name of an HTTP header that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.

Parameters:

header (Optional[str]) – The HTTP header name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheader.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

remove_header_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.RemoveHeaderProperty(
    header="header"
)

Attributes

header

The HTTP header name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheader.html#cfn-cloudfront-responseheaderspolicy-removeheader-header

RemoveHeadersConfigProperty

class CfnResponseHeadersPolicyPropsMixin.RemoveHeadersConfigProperty(*, items=None)

Bases: object

A list of HTTP header names that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.

Parameters:

items (Union[IResolvable, Sequence[Union[IResolvable, RemoveHeaderProperty, Dict[str, Any]]], None]) – The list of HTTP header names.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheadersconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

remove_headers_config_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.RemoveHeadersConfigProperty(
    items=[cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.RemoveHeaderProperty(
        header="header"
    )]
)

Attributes

items

The list of HTTP header names.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheadersconfig.html#cfn-cloudfront-responseheaderspolicy-removeheadersconfig-items

ResponseHeadersPolicyConfigProperty

class CfnResponseHeadersPolicyPropsMixin.ResponseHeadersPolicyConfigProperty(*, comment=None, cors_config=None, custom_headers_config=None, name=None, remove_headers_config=None, security_headers_config=None, server_timing_headers_config=None)

Bases: object

A response headers policy configuration.

A response headers policy configuration contains metadata about the response headers policy, and configurations for sets of HTTP response headers.

Parameters:
  • comment (Optional[str]) – A comment to describe the response headers policy. The comment cannot be longer than 128 characters.

  • cors_config (Union[IResolvable, CorsConfigProperty, Dict[str, Any], None]) – A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).

  • custom_headers_config (Union[IResolvable, CustomHeadersConfigProperty, Dict[str, Any], None]) – A configuration for a set of custom HTTP response headers.

  • name (Optional[str]) – A name to identify the response headers policy. The name must be unique for response headers policies in this AWS account .

  • remove_headers_config (Union[IResolvable, RemoveHeadersConfigProperty, Dict[str, Any], None]) – A configuration for a set of HTTP headers to remove from the HTTP response.

  • security_headers_config (Union[IResolvable, SecurityHeadersConfigProperty, Dict[str, Any], None]) – A configuration for a set of security-related HTTP response headers.

  • server_timing_headers_config (Union[IResolvable, ServerTimingHeadersConfigProperty, Dict[str, Any], None]) – A configuration for enabling the Server-Timing header in HTTP responses sent from CloudFront.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

response_headers_policy_config_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ResponseHeadersPolicyConfigProperty(
    comment="comment",
    cors_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CorsConfigProperty(
        access_control_allow_credentials=False,
        access_control_allow_headers=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowHeadersProperty(
            items=["items"]
        ),
        access_control_allow_methods=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowMethodsProperty(
            items=["items"]
        ),
        access_control_allow_origins=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlAllowOriginsProperty(
            items=["items"]
        ),
        access_control_expose_headers=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.AccessControlExposeHeadersProperty(
            items=["items"]
        ),
        access_control_max_age_sec=123,
        origin_override=False
    ),
    custom_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CustomHeadersConfigProperty(
        items=[cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.CustomHeaderProperty(
            header="header",
            override=False,
            value="value"
        )]
    ),
    name="name",
    remove_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.RemoveHeadersConfigProperty(
        items=[cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.RemoveHeaderProperty(
            header="header"
        )]
    ),
    security_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.SecurityHeadersConfigProperty(
        content_security_policy=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentSecurityPolicyProperty(
            content_security_policy="contentSecurityPolicy",
            override=False
        ),
        content_type_options=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentTypeOptionsProperty(
            override=False
        ),
        frame_options=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.FrameOptionsProperty(
            frame_option="frameOption",
            override=False
        ),
        referrer_policy=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ReferrerPolicyProperty(
            override=False,
            referrer_policy="referrerPolicy"
        ),
        strict_transport_security=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.StrictTransportSecurityProperty(
            access_control_max_age_sec=123,
            include_subdomains=False,
            override=False,
            preload=False
        ),
        xss_protection=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.XSSProtectionProperty(
            mode_block=False,
            override=False,
            protection=False,
            report_uri="reportUri"
        )
    ),
    server_timing_headers_config=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ServerTimingHeadersConfigProperty(
        enabled=False,
        sampling_rate=123
    )
)

Attributes

comment

A comment to describe the response headers policy.

The comment cannot be longer than 128 characters.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-comment

cors_config

A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-corsconfig

custom_headers_config

A configuration for a set of custom HTTP response headers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-customheadersconfig

name

A name to identify the response headers policy.

The name must be unique for response headers policies in this AWS account .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-name

remove_headers_config

A configuration for a set of HTTP headers to remove from the HTTP response.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-removeheadersconfig

security_headers_config

A configuration for a set of security-related HTTP response headers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-securityheadersconfig

server_timing_headers_config

A configuration for enabling the Server-Timing header in HTTP responses sent from CloudFront.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-servertimingheadersconfig

SecurityHeadersConfigProperty

class CfnResponseHeadersPolicyPropsMixin.SecurityHeadersConfigProperty(*, content_security_policy=None, content_type_options=None, frame_options=None, referrer_policy=None, strict_transport_security=None, xss_protection=None)

Bases: object

A configuration for a set of security-related HTTP response headers.

CloudFront adds these headers to HTTP responses that it sends for requests that match a cache behavior associated with this response headers policy.

Parameters:
  • content_security_policy (Union[IResolvable, ContentSecurityPolicyProperty, Dict[str, Any], None]) –

    The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header. For more information about the Content-Security-Policy HTTP response header, see Content-Security-Policy in the MDN Web Docs.

  • content_type_options (Union[IResolvable, ContentTypeOptionsProperty, Dict[str, Any], None]) –

    Determines whether CloudFront includes the X-Content-Type-Options HTTP response header with its value set to nosniff . For more information about the X-Content-Type-Options HTTP response header, see X-Content-Type-Options in the MDN Web Docs.

  • frame_options (Union[IResolvable, FrameOptionsProperty, Dict[str, Any], None]) –

    Determines whether CloudFront includes the X-Frame-Options HTTP response header and the header’s value. For more information about the X-Frame-Options HTTP response header, see X-Frame-Options in the MDN Web Docs.

  • referrer_policy (Union[IResolvable, ReferrerPolicyProperty, Dict[str, Any], None]) –

    Determines whether CloudFront includes the Referrer-Policy HTTP response header and the header’s value. For more information about the Referrer-Policy HTTP response header, see Referrer-Policy in the MDN Web Docs.

  • strict_transport_security (Union[IResolvable, StrictTransportSecurityProperty, Dict[str, Any], None]) – 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 Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.

  • xss_protection (Union[IResolvable, XSSProtectionProperty, Dict[str, Any], None]) – Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header’s value. For more information about the X-XSS-Protection HTTP response header, see X-XSS-Protection in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

security_headers_config_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.SecurityHeadersConfigProperty(
    content_security_policy=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentSecurityPolicyProperty(
        content_security_policy="contentSecurityPolicy",
        override=False
    ),
    content_type_options=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ContentTypeOptionsProperty(
        override=False
    ),
    frame_options=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.FrameOptionsProperty(
        frame_option="frameOption",
        override=False
    ),
    referrer_policy=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ReferrerPolicyProperty(
        override=False,
        referrer_policy="referrerPolicy"
    ),
    strict_transport_security=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.StrictTransportSecurityProperty(
        access_control_max_age_sec=123,
        include_subdomains=False,
        override=False,
        preload=False
    ),
    xss_protection=cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.XSSProtectionProperty(
        mode_block=False,
        override=False,
        protection=False,
        report_uri="reportUri"
    )
)

Attributes

content_security_policy

The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-contentsecuritypolicy

content_type_options

Determines whether CloudFront includes the X-Content-Type-Options HTTP response header with its value set to nosniff .

For more information about the X-Content-Type-Options HTTP response header, see X-Content-Type-Options in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-contenttypeoptions

frame_options

Determines whether CloudFront includes the X-Frame-Options HTTP response header and the header’s value.

For more information about the X-Frame-Options HTTP response header, see X-Frame-Options in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-frameoptions

referrer_policy

Determines whether CloudFront includes the Referrer-Policy HTTP response header and the header’s value.

For more information about the Referrer-Policy HTTP response header, see Referrer-Policy in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-referrerpolicy

strict_transport_security

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 Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-stricttransportsecurity

xss_protection

Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header’s value.

For more information about the X-XSS-Protection HTTP response header, see X-XSS-Protection in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-xssprotection

ServerTimingHeadersConfigProperty

class CfnResponseHeadersPolicyPropsMixin.ServerTimingHeadersConfigProperty(*, enabled=None, sampling_rate=None)

Bases: object

A configuration for enabling the Server-Timing header in HTTP responses sent from CloudFront.

Parameters:
  • enabled (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront adds the Server-Timing header to HTTP responses that it sends in response to requests that match a cache behavior that’s associated with this response headers policy.

  • sampling_rate (Union[int, float, None]) – A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the Server-Timing header to. When you set the sampling rate to 100, CloudFront adds the Server-Timing header to the HTTP response for every request that matches the cache behavior that this response headers policy is attached to. When you set it to 50, CloudFront adds the header to 50% of the responses for requests that match the cache behavior. You can set the sampling rate to any number 0–100 with up to four decimal places.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-servertimingheadersconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

server_timing_headers_config_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.ServerTimingHeadersConfigProperty(
    enabled=False,
    sampling_rate=123
)

Attributes

enabled

A Boolean that determines whether CloudFront adds the Server-Timing header to HTTP responses that it sends in response to requests that match a cache behavior that’s associated with this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-servertimingheadersconfig.html#cfn-cloudfront-responseheaderspolicy-servertimingheadersconfig-enabled

sampling_rate

A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the Server-Timing header to.

When you set the sampling rate to 100, CloudFront adds the Server-Timing header to the HTTP response for every request that matches the cache behavior that this response headers policy is attached to. When you set it to 50, CloudFront adds the header to 50% of the responses for requests that match the cache behavior. You can set the sampling rate to any number 0–100 with up to four decimal places.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-servertimingheadersconfig.html#cfn-cloudfront-responseheaderspolicy-servertimingheadersconfig-samplingrate

StrictTransportSecurityProperty

class CfnResponseHeadersPolicyPropsMixin.StrictTransportSecurityProperty(*, access_control_max_age_sec=None, include_subdomains=None, override=None, preload=None)

Bases: object

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.

Parameters:
  • access_control_max_age_sec (Union[int, float, None]) – A number that CloudFront uses as the value for the max-age directive in the Strict-Transport-Security HTTP response header.

  • include_subdomains (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront includes the includeSubDomains directive in the Strict-Transport-Security HTTP response header.

  • override (Union[bool, IResolvable, None]) – 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.

  • preload (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront includes the preload directive in the Strict-Transport-Security HTTP response header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

strict_transport_security_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.StrictTransportSecurityProperty(
    access_control_max_age_sec=123,
    include_subdomains=False,
    override=False,
    preload=False
)

Attributes

access_control_max_age_sec

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-accesscontrolmaxagesec

include_subdomains

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-includesubdomains

override

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-override

preload

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-preload

XSSProtectionProperty

class CfnResponseHeadersPolicyPropsMixin.XSSProtectionProperty(*, mode_block=None, override=None, protection=None, report_uri=None)

Bases: object

Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header’s value.

For more information about the X-XSS-Protection HTTP response header, see X-XSS-Protection in the MDN Web Docs.

Parameters:
  • mode_block (Union[bool, IResolvable, None]) –

    A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header. For more information about this directive, see X-XSS-Protection in the MDN Web Docs.

  • override (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.

  • protection (Union[bool, IResolvable, None]) –

    A Boolean that determines the value of the X-XSS-Protection HTTP response header. When this setting is true , the value of the X-XSS-Protection header is 1 . When this setting is false , the value of the X-XSS-Protection header is 0 . For more information about these settings, see X-XSS-Protection in the MDN Web Docs.

  • report_uri (Optional[str]) –

    A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header. You cannot specify a ReportUri when ModeBlock is true . For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

x_sSProtection_property = cloudfront_mixins.CfnResponseHeadersPolicyPropsMixin.XSSProtectionProperty(
    mode_block=False,
    override=False,
    protection=False,
    report_uri="reportUri"
)

Attributes

mode_block

A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.

For more information about this directive, see X-XSS-Protection in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-modeblock

override

A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-override

protection

A Boolean that determines the value of the X-XSS-Protection HTTP response header.

When this setting is true , the value of the X-XSS-Protection header is 1 . When this setting is false , the value of the X-XSS-Protection header is 0 .

For more information about these settings, see X-XSS-Protection in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-protection

report_uri

A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.

You cannot specify a ReportUri when ModeBlock is true .

For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-reporturi