CfnResponseHeadersPolicy

class aws_cdk.aws_cloudfront.CfnResponseHeadersPolicy(scope, id, *, response_headers_policy_config)

Bases: aws_cdk.core.CfnResource

A CloudFormation AWS::CloudFront::ResponseHeadersPolicy.

A response headers policy.

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

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, CloudFront adds the headers in the policy to HTTP responses that it sends for requests that match the cache behavior.

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

CloudformationResource

AWS::CloudFront::ResponseHeadersPolicy

Link

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

ExampleMetadata

fixture=_generated

Example:

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

cfn_response_headers_policy = cloudfront.CfnResponseHeadersPolicy(self, "MyCfnResponseHeadersPolicy",
    response_headers_policy_config=cloudfront.CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty(
        name="name",

        # the properties below are optional
        comment="comment",
        cors_config=cloudfront.CfnResponseHeadersPolicy.CorsConfigProperty(
            access_control_allow_credentials=False,
            access_control_allow_headers=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowHeadersProperty(
                items=["items"]
            ),
            access_control_allow_methods=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowMethodsProperty(
                items=["items"]
            ),
            access_control_allow_origins=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowOriginsProperty(
                items=["items"]
            ),
            origin_override=False,

            # the properties below are optional
            access_control_expose_headers=cloudfront.CfnResponseHeadersPolicy.AccessControlExposeHeadersProperty(
                items=["items"]
            ),
            access_control_max_age_sec=123
        ),
        custom_headers_config=cloudfront.CfnResponseHeadersPolicy.CustomHeadersConfigProperty(
            items=[cloudfront.CfnResponseHeadersPolicy.CustomHeaderProperty(
                header="header",
                override=False,
                value="value"
            )]
        ),
        security_headers_config=cloudfront.CfnResponseHeadersPolicy.SecurityHeadersConfigProperty(
            content_security_policy=cloudfront.CfnResponseHeadersPolicy.ContentSecurityPolicyProperty(
                content_security_policy="contentSecurityPolicy",
                override=False
            ),
            content_type_options=cloudfront.CfnResponseHeadersPolicy.ContentTypeOptionsProperty(
                override=False
            ),
            frame_options=cloudfront.CfnResponseHeadersPolicy.FrameOptionsProperty(
                frame_option="frameOption",
                override=False
            ),
            referrer_policy=cloudfront.CfnResponseHeadersPolicy.ReferrerPolicyProperty(
                override=False,
                referrer_policy="referrerPolicy"
            ),
            strict_transport_security=cloudfront.CfnResponseHeadersPolicy.StrictTransportSecurityProperty(
                access_control_max_age_sec=123,
                override=False,

                # the properties below are optional
                include_subdomains=False,
                preload=False
            ),
            xss_protection=cloudfront.CfnResponseHeadersPolicy.XSSProtectionProperty(
                override=False,
                protection=False,

                # the properties below are optional
                mode_block=False,
                report_uri="reportUri"
            )
        )
    )
)

Create a new AWS::CloudFront::ResponseHeadersPolicy.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • response_headers_policy_config (Union[IResolvable, ResponseHeadersPolicyConfigProperty]) – A response headers policy configuration. A response headers policy contains information about a set of HTTP response headers and their values. CloudFront adds the headers in the policy to HTTP responses that it sends for requests that match a cache behavior that’s associated with the policy.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::CloudFront::ResponseHeadersPolicy'
attr_id

The unique identifier for the cache policy.

For example: 57f99797-3b20-4e1b-a728-27972a74082a .

CloudformationAttribute

Id

Return type

str

attr_last_modified_time

The date and time when the response headers policy was last modified.

CloudformationAttribute

LastModifiedTime

Return type

str

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

Return type

ConstructNode

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

response_headers_policy_config

A response headers policy configuration.

A response headers policy contains information about a set of HTTP response headers and their values. CloudFront adds the headers in the policy to HTTP responses that it sends for requests that match a cache behavior that’s associated with the policy.

Link

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

Return type

Union[IResolvable, ResponseHeadersPolicyConfigProperty]

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

AccessControlAllowHeadersProperty

class CfnResponseHeadersPolicy.AccessControlAllowHeadersProperty(*, items)

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 (Sequence[str]) – The list of HTTP header names. You can specify * to allow all headers.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

access_control_allow_headers_property = cloudfront.CfnResponseHeadersPolicy.AccessControlAllowHeadersProperty(
    items=["items"]
)

Attributes

items

The list of HTTP header names.

You can specify * to allow all headers.

Link

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

Return type

List[str]

AccessControlAllowMethodsProperty

class CfnResponseHeadersPolicy.AccessControlAllowMethodsProperty(*, items)

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 (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.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

access_control_allow_methods_property = cloudfront.CfnResponseHeadersPolicy.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.

Link

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

Return type

List[str]

AccessControlAllowOriginsProperty

class CfnResponseHeadersPolicy.AccessControlAllowOriginsProperty(*, items)

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 (Sequence[str]) – The list of origins (domain names). You can specify * to allow all origins.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

access_control_allow_origins_property = cloudfront.CfnResponseHeadersPolicy.AccessControlAllowOriginsProperty(
    items=["items"]
)

Attributes

items

The list of origins (domain names).

You can specify * to allow all origins.

Link

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

Return type

List[str]

AccessControlExposeHeadersProperty

class CfnResponseHeadersPolicy.AccessControlExposeHeadersProperty(*, items)

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 (Sequence[str]) – The list of HTTP headers. You can specify * to expose all headers.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

access_control_expose_headers_property = cloudfront.CfnResponseHeadersPolicy.AccessControlExposeHeadersProperty(
    items=["items"]
)

Attributes

items

The list of HTTP headers.

You can specify * to expose all headers.

Link

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

Return type

List[str]

ContentSecurityPolicyProperty

class CfnResponseHeadersPolicy.ContentSecurityPolicyProperty(*, content_security_policy, override)

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 (str) – The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

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

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

content_security_policy_property = cloudfront.CfnResponseHeadersPolicy.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.

Link

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

Return type

str

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.

Link

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

Return type

Union[bool, IResolvable]

ContentTypeOptionsProperty

class CfnResponseHeadersPolicy.ContentTypeOptionsProperty(*, override)

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]) – 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.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

content_type_options_property = cloudfront.CfnResponseHeadersPolicy.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.

Link

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

Return type

Union[bool, IResolvable]

CorsConfigProperty

class CfnResponseHeadersPolicy.CorsConfigProperty(*, access_control_allow_credentials, access_control_allow_headers, access_control_allow_methods, access_control_allow_origins, origin_override, access_control_expose_headers=None, access_control_max_age_sec=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]) – 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]) –

    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]) –

    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]) –

    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.

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

  • access_control_expose_headers (Union[IResolvable, AccessControlExposeHeadersProperty, 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.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

cors_config_property = cloudfront.CfnResponseHeadersPolicy.CorsConfigProperty(
    access_control_allow_credentials=False,
    access_control_allow_headers=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowHeadersProperty(
        items=["items"]
    ),
    access_control_allow_methods=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowMethodsProperty(
        items=["items"]
    ),
    access_control_allow_origins=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowOriginsProperty(
        items=["items"]
    ),
    origin_override=False,

    # the properties below are optional
    access_control_expose_headers=cloudfront.CfnResponseHeadersPolicy.AccessControlExposeHeadersProperty(
        items=["items"]
    ),
    access_control_max_age_sec=123
)

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.

Link

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

Return type

Union[bool, IResolvable]

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.

Link

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

Return type

Union[IResolvable, AccessControlAllowHeadersProperty]

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.

Link

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

Return type

Union[IResolvable, AccessControlAllowMethodsProperty]

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.

Link

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

Return type

Union[IResolvable, AccessControlAllowOriginsProperty]

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.

Link

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

Return type

Union[IResolvable, AccessControlExposeHeadersProperty, None]

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.

Link

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

Return type

Union[int, float, None]

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.

Link

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

Return type

Union[bool, IResolvable]

CustomHeaderProperty

class CfnResponseHeadersPolicy.CustomHeaderProperty(*, header, override, value)

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 (str) – The HTTP response header name.

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

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

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

custom_header_property = cloudfront.CfnResponseHeadersPolicy.CustomHeaderProperty(
    header="header",
    override=False,
    value="value"
)

Attributes

header

The HTTP response header name.

Link

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

Return type

str

override

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

Link

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

Return type

Union[bool, IResolvable]

value

The value for the HTTP response header.

Link

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

Return type

str

CustomHeadersConfigProperty

class CfnResponseHeadersPolicy.CustomHeadersConfigProperty(*, items)

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]]]) – The list of HTTP response headers and their values.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

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

Attributes

items

The list of HTTP response headers and their values.

Link

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

Return type

Union[IResolvable, List[Union[IResolvable, CustomHeaderProperty]]]

FrameOptionsProperty

class CfnResponseHeadersPolicy.FrameOptionsProperty(*, frame_option, override)

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 (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]) – 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.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

frame_options_property = cloudfront.CfnResponseHeadersPolicy.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.

Link

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

Return type

str

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.

Link

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

Return type

Union[bool, IResolvable]

ReferrerPolicyProperty

class CfnResponseHeadersPolicy.ReferrerPolicyProperty(*, override, referrer_policy)

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]) – 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 (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.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

referrer_policy_property = cloudfront.CfnResponseHeadersPolicy.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.

Link

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

Return type

Union[bool, IResolvable]

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.

Link

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

Return type

str

ResponseHeadersPolicyConfigProperty

class CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty(*, name, comment=None, cors_config=None, custom_headers_config=None, security_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 and their values. CloudFront adds the headers in the policy to HTTP responses that it sends for requests that match a cache behavior associated with the policy.

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

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

  • cors_config (Union[IResolvable, CorsConfigProperty, 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, None]) – A configuration for a set of custom HTTP response headers.

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

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

response_headers_policy_config_property = cloudfront.CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty(
    name="name",

    # the properties below are optional
    comment="comment",
    cors_config=cloudfront.CfnResponseHeadersPolicy.CorsConfigProperty(
        access_control_allow_credentials=False,
        access_control_allow_headers=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowHeadersProperty(
            items=["items"]
        ),
        access_control_allow_methods=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowMethodsProperty(
            items=["items"]
        ),
        access_control_allow_origins=cloudfront.CfnResponseHeadersPolicy.AccessControlAllowOriginsProperty(
            items=["items"]
        ),
        origin_override=False,

        # the properties below are optional
        access_control_expose_headers=cloudfront.CfnResponseHeadersPolicy.AccessControlExposeHeadersProperty(
            items=["items"]
        ),
        access_control_max_age_sec=123
    ),
    custom_headers_config=cloudfront.CfnResponseHeadersPolicy.CustomHeadersConfigProperty(
        items=[cloudfront.CfnResponseHeadersPolicy.CustomHeaderProperty(
            header="header",
            override=False,
            value="value"
        )]
    ),
    security_headers_config=cloudfront.CfnResponseHeadersPolicy.SecurityHeadersConfigProperty(
        content_security_policy=cloudfront.CfnResponseHeadersPolicy.ContentSecurityPolicyProperty(
            content_security_policy="contentSecurityPolicy",
            override=False
        ),
        content_type_options=cloudfront.CfnResponseHeadersPolicy.ContentTypeOptionsProperty(
            override=False
        ),
        frame_options=cloudfront.CfnResponseHeadersPolicy.FrameOptionsProperty(
            frame_option="frameOption",
            override=False
        ),
        referrer_policy=cloudfront.CfnResponseHeadersPolicy.ReferrerPolicyProperty(
            override=False,
            referrer_policy="referrerPolicy"
        ),
        strict_transport_security=cloudfront.CfnResponseHeadersPolicy.StrictTransportSecurityProperty(
            access_control_max_age_sec=123,
            override=False,

            # the properties below are optional
            include_subdomains=False,
            preload=False
        ),
        xss_protection=cloudfront.CfnResponseHeadersPolicy.XSSProtectionProperty(
            override=False,
            protection=False,

            # the properties below are optional
            mode_block=False,
            report_uri="reportUri"
        )
    )
)

Attributes

comment

A comment to describe the response headers policy.

The comment cannot be longer than 128 characters.

Link

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

Return type

Optional[str]

cors_config

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

Link

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

Return type

Union[IResolvable, CorsConfigProperty, None]

custom_headers_config

A configuration for a set of custom HTTP response headers.

Link

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

Return type

Union[IResolvable, CustomHeadersConfigProperty, None]

name

A name to identify the response headers policy.

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

Link

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

Return type

str

security_headers_config

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

Link

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

Return type

Union[IResolvable, SecurityHeadersConfigProperty, None]

SecurityHeadersConfigProperty

class CfnResponseHeadersPolicy.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, 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, 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, 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, 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, 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 Strict-Transport-Security in the MDN Web Docs.

  • xss_protection (Union[IResolvable, XSSProtectionProperty, 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.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

security_headers_config_property = cloudfront.CfnResponseHeadersPolicy.SecurityHeadersConfigProperty(
    content_security_policy=cloudfront.CfnResponseHeadersPolicy.ContentSecurityPolicyProperty(
        content_security_policy="contentSecurityPolicy",
        override=False
    ),
    content_type_options=cloudfront.CfnResponseHeadersPolicy.ContentTypeOptionsProperty(
        override=False
    ),
    frame_options=cloudfront.CfnResponseHeadersPolicy.FrameOptionsProperty(
        frame_option="frameOption",
        override=False
    ),
    referrer_policy=cloudfront.CfnResponseHeadersPolicy.ReferrerPolicyProperty(
        override=False,
        referrer_policy="referrerPolicy"
    ),
    strict_transport_security=cloudfront.CfnResponseHeadersPolicy.StrictTransportSecurityProperty(
        access_control_max_age_sec=123,
        override=False,

        # the properties below are optional
        include_subdomains=False,
        preload=False
    ),
    xss_protection=cloudfront.CfnResponseHeadersPolicy.XSSProtectionProperty(
        override=False,
        protection=False,

        # the properties below are optional
        mode_block=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.

Link

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

Return type

Union[IResolvable, ContentSecurityPolicyProperty, None]

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.

Link

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

Return type

Union[IResolvable, ContentTypeOptionsProperty, None]

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.

Link

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

Return type

Union[IResolvable, FrameOptionsProperty, None]

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.

Link

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

Return type

Union[IResolvable, ReferrerPolicyProperty, None]

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 Strict-Transport-Security in the MDN Web Docs.

Link

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

Return type

Union[IResolvable, StrictTransportSecurityProperty, None]

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.

Link

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

Return type

Union[IResolvable, XSSProtectionProperty, None]

StrictTransportSecurityProperty

class CfnResponseHeadersPolicy.StrictTransportSecurityProperty(*, access_control_max_age_sec, override, include_subdomains=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]) – A number that CloudFront uses as the value for the max-age directive in the Strict-Transport-Security HTTP response header.

  • override (Union[bool, 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 (Union[bool, IResolvable, None]) – A Boolean that determines whether CloudFront includes the includeSubDomains directive in the Strict-Transport-Security HTTP response header.

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

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

strict_transport_security_property = cloudfront.CfnResponseHeadersPolicy.StrictTransportSecurityProperty(
    access_control_max_age_sec=123,
    override=False,

    # the properties below are optional
    include_subdomains=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.

Link

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

Return type

Union[int, float]

include_subdomains

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

Link

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

Return type

Union[bool, IResolvable, None]

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.

Link

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

Return type

Union[bool, IResolvable]

preload

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

Link

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

Return type

Union[bool, IResolvable, None]

XSSProtectionProperty

class CfnResponseHeadersPolicy.XSSProtectionProperty(*, override, protection, mode_block=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
  • override (Union[bool, IResolvable]) – 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]) –

    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.

  • 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.

  • 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.

Link

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.
import aws_cdk.aws_cloudfront as cloudfront

x_sSProtection_property = cloudfront.CfnResponseHeadersPolicy.XSSProtectionProperty(
    override=False,
    protection=False,

    # the properties below are optional
    mode_block=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.

Link

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

Return type

Union[bool, IResolvable, None]

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.

Link

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

Return type

Union[bool, IResolvable]

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.

Link

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

Return type

Union[bool, IResolvable]

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.

Link

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

Return type

Optional[str]