CfnResponseHeadersPolicyPropsMixin
- class aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnResponseHeadersPolicyPropsMixin(props, *, strategy=None)
Bases:
MixinA 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:
- 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:
props (
Union[CfnResponseHeadersPolicyMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AccessControlAllowHeadersProperty
- class CfnResponseHeadersPolicyPropsMixin.AccessControlAllowHeadersProperty(*, items=None)
Bases:
objectA list of HTTP header names that CloudFront includes as values for the
Access-Control-Allow-HeadersHTTP response header.For more information about the
Access-Control-Allow-HeadersHTTP 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:
- 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.
AccessControlAllowMethodsProperty
- class CfnResponseHeadersPolicyPropsMixin.AccessControlAllowMethodsProperty(*, items=None)
Bases:
objectA list of HTTP methods that CloudFront includes as values for the
Access-Control-Allow-MethodsHTTP response header.For more information about the
Access-Control-Allow-MethodsHTTP 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-ALLALLis a special value that includes all of the listed HTTP methods.- See:
- 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
.
GETDELETEHEADOPTIONSPATCHPOSTPUTALL
ALLis a special value that includes all of the listed HTTP methods.- See:
- Type:
The list of HTTP methods. Valid values are
AccessControlAllowOriginsProperty
- class CfnResponseHeadersPolicyPropsMixin.AccessControlAllowOriginsProperty(*, items=None)
Bases:
objectA list of origins (domain names) that CloudFront can use as the value for the
Access-Control-Allow-OriginHTTP response header.For more information about the
Access-Control-Allow-OriginHTTP 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:
- 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.
AccessControlExposeHeadersProperty
- class CfnResponseHeadersPolicyPropsMixin.AccessControlExposeHeadersProperty(*, items=None)
Bases:
objectA list of HTTP headers that CloudFront includes as values for the
Access-Control-Expose-HeadersHTTP response header.For more information about the
Access-Control-Expose-HeadersHTTP 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:
- 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.
ContentSecurityPolicyProperty
- class CfnResponseHeadersPolicyPropsMixin.ContentSecurityPolicyProperty(*, content_security_policy=None, override=None)
Bases:
objectThe policy directives and their values that CloudFront includes as values for the
Content-Security-PolicyHTTP response header.For more information about the
Content-Security-PolicyHTTP 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 theContent-Security-PolicyHTTP response header.override (
Union[bool,IResolvable,None]) – A Boolean that determines whether CloudFront overrides theContent-Security-PolicyHTTP response header received from the origin with the one specified in this response headers policy.
- See:
- 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-PolicyHTTP response header.
- override
A Boolean that determines whether CloudFront overrides the
Content-Security-PolicyHTTP response header received from the origin with the one specified in this response headers policy.
ContentTypeOptionsProperty
- class CfnResponseHeadersPolicyPropsMixin.ContentTypeOptionsProperty(*, override=None)
Bases:
objectDetermines whether CloudFront includes the
X-Content-Type-OptionsHTTP response header with its value set tonosniff.For more information about the
X-Content-Type-OptionsHTTP 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 theX-Content-Type-OptionsHTTP response header received from the origin with the one specified in this response headers policy.- See:
- 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-OptionsHTTP response header received from the origin with the one specified in this response headers policy.
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:
objectA 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 theAccess-Control-Allow-CredentialsHTTP response header. For more information about theAccess-Control-Allow-CredentialsHTTP 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-HeadersHTTP response header. For more information about theAccess-Control-Allow-HeadersHTTP 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-MethodsHTTP response header. For more information about theAccess-Control-Allow-MethodsHTTP 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-OriginHTTP response header. For more information about theAccess-Control-Allow-OriginHTTP 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-HeadersHTTP response header. For more information about theAccess-Control-Expose-HeadersHTTP 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 theAccess-Control-Max-AgeHTTP response header. For more information about theAccess-Control-Max-AgeHTTP 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:
- 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-CredentialsHTTP response header.For more information about the
Access-Control-Allow-CredentialsHTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.
- access_control_allow_headers
A list of HTTP header names that CloudFront includes as values for the
Access-Control-Allow-HeadersHTTP response header.For more information about the
Access-Control-Allow-HeadersHTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.
- access_control_allow_methods
A list of HTTP methods that CloudFront includes as values for the
Access-Control-Allow-MethodsHTTP response header.For more information about the
Access-Control-Allow-MethodsHTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.
- access_control_allow_origins
A list of origins (domain names) that CloudFront can use as the value for the
Access-Control-Allow-OriginHTTP response header.For more information about the
Access-Control-Allow-OriginHTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.
- access_control_expose_headers
A list of HTTP headers that CloudFront includes as values for the
Access-Control-Expose-HeadersHTTP response header.For more information about the
Access-Control-Expose-HeadersHTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.
- access_control_max_age_sec
A number that CloudFront uses as the value for the
Access-Control-Max-AgeHTTP response header.For more information about the
Access-Control-Max-AgeHTTP response header, see Access-Control-Max-Age in the MDN Web Docs.
- 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.
CustomHeaderProperty
- class CfnResponseHeadersPolicyPropsMixin.CustomHeaderProperty(*, header=None, override=None, value=None)
Bases:
objectAn 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:
- 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.
- override
A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.
- value
The value for the HTTP response header.
CustomHeadersConfigProperty
- class CfnResponseHeadersPolicyPropsMixin.CustomHeadersConfigProperty(*, items=None)
Bases:
objectA 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:
- 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.
FrameOptionsProperty
- class CfnResponseHeadersPolicyPropsMixin.FrameOptionsProperty(*, frame_option=None, override=None)
Bases:
objectDetermines whether CloudFront includes the
X-Frame-OptionsHTTP response header and the header’s value.For more information about the
X-Frame-OptionsHTTP response header, see X-Frame-Options in the MDN Web Docs.- Parameters:
frame_option (
Optional[str]) –The value of the
X-Frame-OptionsHTTP response header. Valid values areDENYandSAMEORIGIN. 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 theX-Frame-OptionsHTTP response header received from the origin with the one specified in this response headers policy.
- See:
- 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-OptionsHTTP response header. Valid values areDENYandSAMEORIGIN.For more information about these values, see X-Frame-Options in the MDN Web Docs.
- override
A Boolean that determines whether CloudFront overrides the
X-Frame-OptionsHTTP response header received from the origin with the one specified in this response headers policy.
ReferrerPolicyProperty
- class CfnResponseHeadersPolicyPropsMixin.ReferrerPolicyProperty(*, override=None, referrer_policy=None)
Bases:
objectDetermines whether CloudFront includes the
Referrer-PolicyHTTP response header and the header’s value.For more information about the
Referrer-PolicyHTTP response header, see Referrer-Policy in the MDN Web Docs.- Parameters:
override (
Union[bool,IResolvable,None]) – A Boolean that determines whether CloudFront overrides theReferrer-PolicyHTTP response header received from the origin with the one specified in this response headers policy.referrer_policy (
Optional[str]) –The value of the
Referrer-PolicyHTTP 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-urlFor more information about these values, see Referrer-Policy in the MDN Web Docs.
- See:
- 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-PolicyHTTP response header received from the origin with the one specified in this response headers policy.
- referrer_policy
.
no-referrerno-referrer-when-downgradeoriginorigin-when-cross-originsame-originstrict-originstrict-origin-when-cross-originunsafe-url
For more information about these values, see Referrer-Policy in the MDN Web Docs.
- See:
- Type:
The value of the
Referrer-PolicyHTTP response header. Valid values are
RemoveHeaderProperty
- class CfnResponseHeadersPolicyPropsMixin.RemoveHeaderProperty(*, header=None)
Bases:
objectThe 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:
- 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
RemoveHeadersConfigProperty
- class CfnResponseHeadersPolicyPropsMixin.RemoveHeadersConfigProperty(*, items=None)
Bases:
objectA 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:
- 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
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:
objectA 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 theServer-Timingheader in HTTP responses sent from CloudFront.
- See:
- 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.
- cors_config
A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).
- custom_headers_config
A configuration for a set of custom HTTP response headers.
- name
A name to identify the response headers policy.
The name must be unique for response headers policies in this AWS account .
- remove_headers_config
A configuration for a set of HTTP headers to remove from the HTTP response.
- security_headers_config
A configuration for a set of security-related HTTP response headers.
- server_timing_headers_config
A configuration for enabling the
Server-Timingheader in HTTP responses sent from CloudFront.
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:
objectA 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-PolicyHTTP response header. For more information about theContent-Security-PolicyHTTP 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-OptionsHTTP response header with its value set tonosniff. For more information about theX-Content-Type-OptionsHTTP 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-OptionsHTTP response header and the header’s value. For more information about theX-Frame-OptionsHTTP 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-PolicyHTTP response header and the header’s value. For more information about theReferrer-PolicyHTTP response header, see Referrer-Policy in the MDN Web Docs.strict_transport_security (
Union[IResolvable,StrictTransportSecurityProperty,Dict[str,Any],None]) – Determines whether CloudFront includes theStrict-Transport-SecurityHTTP response header and the header’s value. For more information about theStrict-Transport-SecurityHTTP 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 theX-XSS-ProtectionHTTP response header and the header’s value. For more information about theX-XSS-ProtectionHTTP response header, see X-XSS-Protection in the MDN Web Docs.
- See:
- 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-PolicyHTTP response header.For more information about the
Content-Security-PolicyHTTP response header, see Content-Security-Policy in the MDN Web Docs.
- content_type_options
Determines whether CloudFront includes the
X-Content-Type-OptionsHTTP response header with its value set tonosniff.For more information about the
X-Content-Type-OptionsHTTP response header, see X-Content-Type-Options in the MDN Web Docs.
- frame_options
Determines whether CloudFront includes the
X-Frame-OptionsHTTP response header and the header’s value.For more information about the
X-Frame-OptionsHTTP response header, see X-Frame-Options in the MDN Web Docs.
- referrer_policy
Determines whether CloudFront includes the
Referrer-PolicyHTTP response header and the header’s value.For more information about the
Referrer-PolicyHTTP response header, see Referrer-Policy in the MDN Web Docs.
- strict_transport_security
Determines whether CloudFront includes the
Strict-Transport-SecurityHTTP response header and the header’s value.For more information about the
Strict-Transport-SecurityHTTP response header, see Security headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security in the MDN Web Docs.
- xss_protection
Determines whether CloudFront includes the
X-XSS-ProtectionHTTP response header and the header’s value.For more information about the
X-XSS-ProtectionHTTP response header, see X-XSS-Protection in the MDN Web Docs.
ServerTimingHeadersConfigProperty
- class CfnResponseHeadersPolicyPropsMixin.ServerTimingHeadersConfigProperty(*, enabled=None, sampling_rate=None)
Bases:
objectA configuration for enabling the
Server-Timingheader in HTTP responses sent from CloudFront.- Parameters:
enabled (
Union[bool,IResolvable,None]) – A Boolean that determines whether CloudFront adds theServer-Timingheader 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 theServer-Timingheader to. When you set the sampling rate to 100, CloudFront adds theServer-Timingheader 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:
- 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-Timingheader 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
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the
Server-Timingheader to.When you set the sampling rate to 100, CloudFront adds the
Server-Timingheader 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.
StrictTransportSecurityProperty
- class CfnResponseHeadersPolicyPropsMixin.StrictTransportSecurityProperty(*, access_control_max_age_sec=None, include_subdomains=None, override=None, preload=None)
Bases:
objectDetermines whether CloudFront includes the
Strict-Transport-SecurityHTTP response header and the header’s value.For more information about the
Strict-Transport-SecurityHTTP 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 themax-agedirective in theStrict-Transport-SecurityHTTP response header.include_subdomains (
Union[bool,IResolvable,None]) – A Boolean that determines whether CloudFront includes theincludeSubDomainsdirective in theStrict-Transport-SecurityHTTP response header.override (
Union[bool,IResolvable,None]) – A Boolean that determines whether CloudFront overrides theStrict-Transport-SecurityHTTP 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 thepreloaddirective in theStrict-Transport-SecurityHTTP response header.
- See:
- 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-agedirective in theStrict-Transport-SecurityHTTP response header.
- include_subdomains
A Boolean that determines whether CloudFront includes the
includeSubDomainsdirective in theStrict-Transport-SecurityHTTP response header.
- override
A Boolean that determines whether CloudFront overrides the
Strict-Transport-SecurityHTTP response header received from the origin with the one specified in this response headers policy.
- preload
A Boolean that determines whether CloudFront includes the
preloaddirective in theStrict-Transport-SecurityHTTP response header.
XSSProtectionProperty
- class CfnResponseHeadersPolicyPropsMixin.XSSProtectionProperty(*, mode_block=None, override=None, protection=None, report_uri=None)
Bases:
objectDetermines whether CloudFront includes the
X-XSS-ProtectionHTTP response header and the header’s value.For more information about the
X-XSS-ProtectionHTTP 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=blockdirective in theX-XSS-Protectionheader. 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 theX-XSS-ProtectionHTTP 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-ProtectionHTTP response header. When this setting istrue, the value of theX-XSS-Protectionheader is1. When this setting isfalse, the value of theX-XSS-Protectionheader is0. 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
reportdirective in theX-XSS-Protectionheader. You cannot specify aReportUriwhenModeBlockistrue. For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.
- See:
- 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=blockdirective in theX-XSS-Protectionheader.For more information about this directive, see X-XSS-Protection in the MDN Web Docs.
- override
A Boolean that determines whether CloudFront overrides the
X-XSS-ProtectionHTTP response header received from the origin with the one specified in this response headers policy.
- protection
A Boolean that determines the value of the
X-XSS-ProtectionHTTP response header.When this setting is
true, the value of theX-XSS-Protectionheader is1. When this setting isfalse, the value of theX-XSS-Protectionheader is0.For more information about these settings, see X-XSS-Protection in the MDN Web Docs.
- report_uri
A reporting URI, which CloudFront uses as the value of the
reportdirective in theX-XSS-Protectionheader.You cannot specify a
ReportUriwhenModeBlockistrue.For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.