CfnOriginRequestPolicyPropsMixin
- class aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnOriginRequestPolicyPropsMixin(props, *, strategy=None)
Bases:
MixinAn origin request policy.
When it’s attached to a cache behavior, the origin request policy determines the values that CloudFront includes in requests that it sends to the origin. Each request that CloudFront sends to the origin includes the following:
The request body and the URL path (without the domain name) from the viewer request.
The headers that CloudFront automatically includes in every origin request, including
Host,User-Agent, andX-Amz-Cf-Id.All HTTP headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.
CloudFront sends a request when it can’t find an object in its cache that matches the request. If you want to send values to the origin and also include them in the cache key, use
CachePolicy.- See:
- CloudformationResource:
AWS::CloudFront::OriginRequestPolicy
- 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_origin_request_policy_props_mixin = cloudfront_mixins.CfnOriginRequestPolicyPropsMixin(cloudfront_mixins.CfnOriginRequestPolicyMixinProps( origin_request_policy_config=cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.OriginRequestPolicyConfigProperty( comment="comment", cookies_config=cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.CookiesConfigProperty( cookie_behavior="cookieBehavior", cookies=["cookies"] ), headers_config=cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.HeadersConfigProperty( header_behavior="headerBehavior", headers=["headers"] ), name="name", query_strings_config=cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.QueryStringsConfigProperty( query_string_behavior="queryStringBehavior", query_strings=["queryStrings"] ) ) ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::CloudFront::OriginRequestPolicy.- Parameters:
props (
Union[CfnOriginRequestPolicyMixinProps,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 = ['originRequestPolicyConfig']
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
HeadersConfigProperty
- class CfnOriginRequestPolicyPropsMixin.HeadersConfigProperty(*, header_behavior=None, headers=None)
Bases:
objectAn object that determines whether any HTTP headers (and if so, which headers) are included in requests that CloudFront sends to the origin.
- Parameters:
header_behavior (
Optional[str]) – Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:. -none– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone, any headers that are listed in aCachePolicyare included in origin requests. -whitelist– Only the HTTP headers that are listed in theHeaderstype are included in requests that CloudFront sends to the origin. -allViewer– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. -allViewerAndWhitelistCloudFront– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaderstype are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront. -allExcept– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaderstype, which are not included.headers (
Optional[Sequence[str]]) – Contains a 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 headers_config_property = cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.HeadersConfigProperty( header_behavior="headerBehavior", headers=["headers"] )
Attributes
- header_behavior
.
none– No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone, any headers that are listed in aCachePolicyare included in origin requests.whitelist– Only the HTTP headers that are listed in theHeaderstype are included in requests that CloudFront sends to the origin.allViewer– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.allViewerAndWhitelistCloudFront– All HTTP headers in viewer requests and the additional CloudFront headers that are listed in theHeaderstype are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.allExcept– All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theHeaderstype, which are not included.
- See:
- Type:
Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are
- headers
Contains a list of HTTP header names.
OriginRequestPolicyConfigProperty
- class CfnOriginRequestPolicyPropsMixin.OriginRequestPolicyConfigProperty(*, comment=None, cookies_config=None, headers_config=None, name=None, query_strings_config=None)
Bases:
objectAn origin request policy configuration.
This configuration determines the values that CloudFront includes in requests that it sends to the origin. Each request that CloudFront sends to the origin includes the following:
The request body and the URL path (without the domain name) from the viewer request.
The headers that CloudFront automatically includes in every origin request, including
Host,User-Agent, andX-Amz-Cf-Id.All HTTP headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.
CloudFront sends a request when it can’t find an object in its cache that matches the request. If you want to send values to the origin and also include them in the cache key, use
CachePolicy.- Parameters:
comment (
Optional[str]) – A comment to describe the origin request policy. The comment cannot be longer than 128 characters.cookies_config (
Union[IResolvable,CookiesConfigProperty,Dict[str,Any],None]) – The cookies from viewer requests to include in origin requests.headers_config (
Union[IResolvable,HeadersConfigProperty,Dict[str,Any],None]) – The HTTP headers to include in origin requests. These can include headers from viewer requests and additional headers added by CloudFront.name (
Optional[str]) – A unique name to identify the origin request policy.query_strings_config (
Union[IResolvable,QueryStringsConfigProperty,Dict[str,Any],None]) – The URL query strings from viewer requests to include in origin requests.
- 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 origin_request_policy_config_property = cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.OriginRequestPolicyConfigProperty( comment="comment", cookies_config=cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.CookiesConfigProperty( cookie_behavior="cookieBehavior", cookies=["cookies"] ), headers_config=cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.HeadersConfigProperty( header_behavior="headerBehavior", headers=["headers"] ), name="name", query_strings_config=cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.QueryStringsConfigProperty( query_string_behavior="queryStringBehavior", query_strings=["queryStrings"] ) )
Attributes
- comment
A comment to describe the origin request policy.
The comment cannot be longer than 128 characters.
- cookies_config
The cookies from viewer requests to include in origin requests.
- headers_config
The HTTP headers to include in origin requests.
These can include headers from viewer requests and additional headers added by CloudFront.
- name
A unique name to identify the origin request policy.
- query_strings_config
The URL query strings from viewer requests to include in origin requests.
QueryStringsConfigProperty
- class CfnOriginRequestPolicyPropsMixin.QueryStringsConfigProperty(*, query_string_behavior=None, query_strings=None)
Bases:
objectAn object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in requests that CloudFront sends to the origin.
- Parameters:
query_string_behavior (
Optional[str]) – Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin. Valid values are: -none– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone, any query strings that are listed in aCachePolicyare included in origin requests. -whitelist– Only the query strings in viewer requests that are listed in theQueryStringNamestype are included in requests that CloudFront sends to the origin. -all– All query strings in viewer requests are included in requests that CloudFront sends to the origin. -allExcept– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNamestype, which are not included.query_strings (
Optional[Sequence[str]]) – Contains a list of query string 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 query_strings_config_property = cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.QueryStringsConfigProperty( query_string_behavior="queryStringBehavior", query_strings=["queryStrings"] )
Attributes
- query_string_behavior
Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin.
Valid values are:
none– No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set tonone, any query strings that are listed in aCachePolicyare included in origin requests.whitelist– Only the query strings in viewer requests that are listed in theQueryStringNamestype are included in requests that CloudFront sends to the origin.all– All query strings in viewer requests are included in requests that CloudFront sends to the origin.allExcept– All query strings in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in theQueryStringNamestype, which are not included.
- query_strings
Contains a list of query string names.