CfnOriginRequestPolicyPropsMixin

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

Bases: Mixin

An 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 , and X-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:

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

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:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['originRequestPolicyConfig']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

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

Stability:

experimental

CookiesConfigProperty

class CfnOriginRequestPolicyPropsMixin.CookiesConfigProperty(*, cookie_behavior=None, cookies=None)

Bases: object

An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in requests that CloudFront sends to the origin.

Parameters:
  • cookie_behavior (Optional[str]) – Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:. - none – No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set to none , any cookies that are listed in a CachePolicy are included in origin requests. - whitelist – Only the cookies in viewer requests that are listed in the CookieNames type are included in requests that CloudFront sends to the origin. - all – All cookies in viewer requests are included in requests that CloudFront sends to the origin. - allExcept – All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in the CookieNames type, which are not included.

  • cookies (Optional[Sequence[str]]) – Contains a list of cookie names.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-cookiesconfig.html

ExampleMetadata:

fixture=_generated

Example:

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

cookies_config_property = cloudfront_mixins.CfnOriginRequestPolicyPropsMixin.CookiesConfigProperty(
    cookie_behavior="cookieBehavior",
    cookies=["cookies"]
)

Attributes

cookie_behavior

.

  • none – No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set to none , any cookies that are listed in a CachePolicy are included in origin requests.

  • whitelist – Only the cookies in viewer requests that are listed in the CookieNames type are included in requests that CloudFront sends to the origin.

  • all – All cookies in viewer requests are included in requests that CloudFront sends to the origin.

  • allExcept – All cookies in viewer requests are included in requests that CloudFront sends to the origin, except for those listed in the CookieNames type, which are not included.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-cookiesconfig.html#cfn-cloudfront-originrequestpolicy-cookiesconfig-cookiebehavior

Type:

Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are

cookies

Contains a list of cookie names.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-cookiesconfig.html#cfn-cloudfront-originrequestpolicy-cookiesconfig-cookies

HeadersConfigProperty

class CfnOriginRequestPolicyPropsMixin.HeadersConfigProperty(*, header_behavior=None, headers=None)

Bases: object

An 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 to none , any headers that are listed in a CachePolicy are included in origin requests. - whitelist – Only the HTTP headers that are listed in the Headers type 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 the Headers type 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 the Headers type, which are not included.

  • headers (Optional[Sequence[str]]) – Contains a list of HTTP header names.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-headersconfig.html

ExampleMetadata:

fixture=_generated

Example:

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

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 to none , any headers that are listed in a CachePolicy are included in origin requests.

  • whitelist – Only the HTTP headers that are listed in the Headers type 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 the Headers type 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 the Headers type, which are not included.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-headersconfig.html#cfn-cloudfront-originrequestpolicy-headersconfig-headerbehavior

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-headersconfig.html#cfn-cloudfront-originrequestpolicy-headersconfig-headers

OriginRequestPolicyConfigProperty

class CfnOriginRequestPolicyPropsMixin.OriginRequestPolicyConfigProperty(*, comment=None, cookies_config=None, headers_config=None, name=None, query_strings_config=None)

Bases: object

An 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 , and X-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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html

ExampleMetadata:

fixture=_generated

Example:

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

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.

See:

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

cookies_config

The cookies from viewer requests to include in origin requests.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-cookiesconfig

headers_config

The HTTP headers to include in origin requests.

These can include headers from viewer requests and additional headers added by CloudFront.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-headersconfig

name

A unique name to identify the origin request policy.

See:

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

query_strings_config

The URL query strings from viewer requests to include in origin requests.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-querystringsconfig

QueryStringsConfigProperty

class CfnOriginRequestPolicyPropsMixin.QueryStringsConfigProperty(*, query_string_behavior=None, query_strings=None)

Bases: object

An 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 to none , any query strings that are listed in a CachePolicy are included in origin requests. - whitelist – Only the query strings in viewer requests that are listed in the QueryStringNames type 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 the QueryStringNames type, which are not included.

  • query_strings (Optional[Sequence[str]]) – Contains a list of query string names.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-querystringsconfig.html

ExampleMetadata:

fixture=_generated

Example:

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

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 to none , any query strings that are listed in a CachePolicy are included in origin requests.

  • whitelist – Only the query strings in viewer requests that are listed in the QueryStringNames type 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 the QueryStringNames type, which are not included.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-querystringsconfig.html#cfn-cloudfront-originrequestpolicy-querystringsconfig-querystringbehavior

query_strings

Contains a list of query string names.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-querystringsconfig.html#cfn-cloudfront-originrequestpolicy-querystringsconfig-querystrings