CfnCachePolicyPropsMixin

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

Bases: Mixin

A cache policy.

When it’s attached to a cache behavior, the cache policy determines the following:

  • The values that CloudFront includes in the cache key. These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer.

  • The default, minimum, and maximum time to live (TTL) values that you want objects to stay in the CloudFront cache.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can’t find a valid object in its cache that matches the request’s cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy .

See:

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

CloudformationResource:

AWS::CloudFront::CachePolicy

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_cache_policy_props_mixin = cloudfront_mixins.CfnCachePolicyPropsMixin(cloudfront_mixins.CfnCachePolicyMixinProps(
    cache_policy_config=cloudfront_mixins.CfnCachePolicyPropsMixin.CachePolicyConfigProperty(
        comment="comment",
        default_ttl=123,
        max_ttl=123,
        min_ttl=123,
        name="name",
        parameters_in_cache_key_and_forwarded_to_origin=cloudfront_mixins.CfnCachePolicyPropsMixin.ParametersInCacheKeyAndForwardedToOriginProperty(
            cookies_config=cloudfront_mixins.CfnCachePolicyPropsMixin.CookiesConfigProperty(
                cookie_behavior="cookieBehavior",
                cookies=["cookies"]
            ),
            enable_accept_encoding_brotli=False,
            enable_accept_encoding_gzip=False,
            headers_config=cloudfront_mixins.CfnCachePolicyPropsMixin.HeadersConfigProperty(
                header_behavior="headerBehavior",
                headers=["headers"]
            ),
            query_strings_config=cloudfront_mixins.CfnCachePolicyPropsMixin.QueryStringsConfigProperty(
                query_string_behavior="queryStringBehavior",
                query_strings=["queryStrings"]
            )
        )
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

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

Parameters:
  • props (Union[CfnCachePolicyMixinProps, 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:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['cachePolicyConfig']

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

CachePolicyConfigProperty

class CfnCachePolicyPropsMixin.CachePolicyConfigProperty(*, comment=None, default_ttl=None, max_ttl=None, min_ttl=None, name=None, parameters_in_cache_key_and_forwarded_to_origin=None)

Bases: object

A cache policy configuration.

This configuration determines the following:

  • The values that CloudFront includes in the cache key. These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer.

  • The default, minimum, and maximum time to live (TTL) values that you want objects to stay in the CloudFront cache.

If your minimum TTL is greater than 0, CloudFront will cache content for at least the duration specified in the cache policy’s minimum TTL, even if the Cache-Control: no-cache , no-store , or private directives are present in the origin headers.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can’t find a valid object in its cache that matches the request’s cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy .

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

  • default_ttl (Union[int, float, None]) – The default amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. CloudFront uses this value as the object’s time to live (TTL) only when the origin does not send Cache-Control or Expires headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . The default value for this field is 86400 seconds (one day). If the value of MinTTL is more than 86400 seconds, then the default value for this field is the same as the value of MinTTL .

  • max_ttl (Union[int, float, None]) –

    The maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. CloudFront uses this value only when the origin sends Cache-Control or Expires headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide . The default value for this field is 31536000 seconds (one year). If the value of MinTTL or DefaultTTL is more than 31536000 seconds, then the default value for this field is the same as the value of DefaultTTL .

  • min_ttl (Union[int, float, None]) –

    The minimum amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .

  • name (Optional[str]) – A unique name to identify the cache policy.

  • parameters_in_cache_key_and_forwarded_to_origin (Union[IResolvable, ParametersInCacheKeyAndForwardedToOriginProperty, Dict[str, Any], None]) – The HTTP headers, cookies, and URL query strings to include in the cache key. The values included in the cache key are also included in requests that CloudFront sends to the origin.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.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

cache_policy_config_property = cloudfront_mixins.CfnCachePolicyPropsMixin.CachePolicyConfigProperty(
    comment="comment",
    default_ttl=123,
    max_ttl=123,
    min_ttl=123,
    name="name",
    parameters_in_cache_key_and_forwarded_to_origin=cloudfront_mixins.CfnCachePolicyPropsMixin.ParametersInCacheKeyAndForwardedToOriginProperty(
        cookies_config=cloudfront_mixins.CfnCachePolicyPropsMixin.CookiesConfigProperty(
            cookie_behavior="cookieBehavior",
            cookies=["cookies"]
        ),
        enable_accept_encoding_brotli=False,
        enable_accept_encoding_gzip=False,
        headers_config=cloudfront_mixins.CfnCachePolicyPropsMixin.HeadersConfigProperty(
            header_behavior="headerBehavior",
            headers=["headers"]
        ),
        query_strings_config=cloudfront_mixins.CfnCachePolicyPropsMixin.QueryStringsConfigProperty(
            query_string_behavior="queryStringBehavior",
            query_strings=["queryStrings"]
        )
    )
)

Attributes

comment

A comment to describe the cache policy.

The comment cannot be longer than 128 characters.

See:

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

default_ttl

The default amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

CloudFront uses this value as the object’s time to live (TTL) only when the origin does not send Cache-Control or Expires headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .

The default value for this field is 86400 seconds (one day). If the value of MinTTL is more than 86400 seconds, then the default value for this field is the same as the value of MinTTL .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-defaultttl

max_ttl

The maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

CloudFront uses this value only when the origin sends Cache-Control or Expires headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .

The default value for this field is 31536000 seconds (one year). If the value of MinTTL or DefaultTTL is more than 31536000 seconds, then the default value for this field is the same as the value of DefaultTTL .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-maxttl

min_ttl

The minimum amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-minttl

name

A unique name to identify the cache policy.

See:

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

parameters_in_cache_key_and_forwarded_to_origin

The HTTP headers, cookies, and URL query strings to include in the cache key.

The values included in the cache key are also included in requests that CloudFront sends to the origin.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-parametersincachekeyandforwardedtoorigin

CookiesConfigProperty

class CfnCachePolicyPropsMixin.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 the cache key and in requests that CloudFront sends to the origin.

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

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-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.CfnCachePolicyPropsMixin.CookiesConfigProperty(
    cookie_behavior="cookieBehavior",
    cookies=["cookies"]
)

Attributes

cookie_behavior

Determines whether any cookies in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.

Valid values are:

  • none – No cookies in viewer requests are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to none , any cookies that are listed in an OriginRequestPolicy are included in origin requests.

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

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

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

See:

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

cookies

Contains a list of cookie names.

See:

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

HeadersConfigProperty

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

Bases: object

An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.

Parameters:
  • header_behavior (Optional[str]) – Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin. Valid values are: - none – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to none , any headers that are listed in an OriginRequestPolicy are included in origin requests. - whitelist – Only the HTTP headers that are listed in the Headers type are included in the cache key and in requests that CloudFront sends to the origin.

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-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.CfnCachePolicyPropsMixin.HeadersConfigProperty(
    header_behavior="headerBehavior",
    headers=["headers"]
)

Attributes

header_behavior

Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin.

Valid values are:

  • none – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to none , any headers that are listed in an OriginRequestPolicy are included in origin requests.

  • whitelist – Only the HTTP headers that are listed in the Headers type are included in the cache key and in requests that CloudFront sends to the origin.

See:

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

headers

Contains a list of HTTP header names.

See:

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

ParametersInCacheKeyAndForwardedToOriginProperty

class CfnCachePolicyPropsMixin.ParametersInCacheKeyAndForwardedToOriginProperty(*, cookies_config=None, enable_accept_encoding_brotli=None, enable_accept_encoding_gzip=None, headers_config=None, query_strings_config=None)

Bases: object

This object determines the values that CloudFront includes in the cache key.

These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can’t find an object in its cache that matches the request’s cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy .

Parameters:
  • cookies_config (Union[IResolvable, CookiesConfigProperty, Dict[str, Any], None]) – An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the cache key and in requests that CloudFront sends to the origin.

  • enable_accept_encoding_brotli (Union[bool, IResolvable, None]) – A flag that can affect whether the Accept-Encoding HTTP header is included in the cache key and included in requests that CloudFront sends to the origin. This field is related to the EnableAcceptEncodingGzip field. If one or both of these fields is true and the viewer request includes the Accept-Encoding header, then CloudFront does the following: - Normalizes the value of the viewer’s Accept-Encoding header - Includes the normalized header in the cache key - Includes the normalized header in the request to the origin, if a request is necessary For more information, see Compression support in the Amazon CloudFront Developer Guide . If you set this value to true , and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding header in the origin request policy. CloudFront always includes the Accept-Encoding header in origin requests when the value of this field is true , so including this header in an origin request policy has no effect. If both of these fields are false , then CloudFront treats the Accept-Encoding header the same as any other HTTP header in the viewer request. By default, it’s not included in the cache key and it’s not included in origin requests. In this case, you can manually add Accept-Encoding to the headers whitelist like any other HTTP header.

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

    A flag that can affect whether the Accept-Encoding HTTP header is included in the cache key and included in requests that CloudFront sends to the origin. This field is related to the EnableAcceptEncodingBrotli field. If one or both of these fields is true and the viewer request includes the Accept-Encoding header, then CloudFront does the following: - Normalizes the value of the viewer’s Accept-Encoding header - Includes the normalized header in the cache key - Includes the normalized header in the request to the origin, if a request is necessary For more information, see Compression support in the Amazon CloudFront Developer Guide . If you set this value to true , and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding header in the origin request policy. CloudFront always includes the Accept-Encoding header in origin requests when the value of this field is true , so including this header in an origin request policy has no effect. If both of these fields are false , then CloudFront treats the Accept-Encoding header the same as any other HTTP header in the viewer request. By default, it’s not included in the cache key and it’s not included in origin requests. In this case, you can manually add Accept-Encoding to the headers whitelist like any other HTTP header.

  • headers_config (Union[IResolvable, HeadersConfigProperty, Dict[str, Any], None]) – An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.

  • query_strings_config (Union[IResolvable, QueryStringsConfigProperty, Dict[str, Any], None]) – An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the cache key and in requests that CloudFront sends to the origin.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.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

parameters_in_cache_key_and_forwarded_to_origin_property = cloudfront_mixins.CfnCachePolicyPropsMixin.ParametersInCacheKeyAndForwardedToOriginProperty(
    cookies_config=cloudfront_mixins.CfnCachePolicyPropsMixin.CookiesConfigProperty(
        cookie_behavior="cookieBehavior",
        cookies=["cookies"]
    ),
    enable_accept_encoding_brotli=False,
    enable_accept_encoding_gzip=False,
    headers_config=cloudfront_mixins.CfnCachePolicyPropsMixin.HeadersConfigProperty(
        header_behavior="headerBehavior",
        headers=["headers"]
    ),
    query_strings_config=cloudfront_mixins.CfnCachePolicyPropsMixin.QueryStringsConfigProperty(
        query_string_behavior="queryStringBehavior",
        query_strings=["queryStrings"]
    )
)

Attributes

cookies_config

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

See:

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

enable_accept_encoding_brotli

A flag that can affect whether the Accept-Encoding HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.

This field is related to the EnableAcceptEncodingGzip field. If one or both of these fields is true and the viewer request includes the Accept-Encoding header, then CloudFront does the following:

  • Normalizes the value of the viewer’s Accept-Encoding header

  • Includes the normalized header in the cache key

  • Includes the normalized header in the request to the origin, if a request is necessary

For more information, see Compression support in the Amazon CloudFront Developer Guide .

If you set this value to true , and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding header in the origin request policy. CloudFront always includes the Accept-Encoding header in origin requests when the value of this field is true , so including this header in an origin request policy has no effect.

If both of these fields are false , then CloudFront treats the Accept-Encoding header the same as any other HTTP header in the viewer request. By default, it’s not included in the cache key and it’s not included in origin requests. In this case, you can manually add Accept-Encoding to the headers whitelist like any other HTTP header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html#cfn-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin-enableacceptencodingbrotli

enable_accept_encoding_gzip

A flag that can affect whether the Accept-Encoding HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.

This field is related to the EnableAcceptEncodingBrotli field. If one or both of these fields is true and the viewer request includes the Accept-Encoding header, then CloudFront does the following:

  • Normalizes the value of the viewer’s Accept-Encoding header

  • Includes the normalized header in the cache key

  • Includes the normalized header in the request to the origin, if a request is necessary

For more information, see Compression support in the Amazon CloudFront Developer Guide .

If you set this value to true , and this cache behavior also has an origin request policy attached, do not include the Accept-Encoding header in the origin request policy. CloudFront always includes the Accept-Encoding header in origin requests when the value of this field is true , so including this header in an origin request policy has no effect.

If both of these fields are false , then CloudFront treats the Accept-Encoding header the same as any other HTTP header in the viewer request. By default, it’s not included in the cache key and it’s not included in origin requests. In this case, you can manually add Accept-Encoding to the headers whitelist like any other HTTP header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html#cfn-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin-enableacceptencodinggzip

headers_config

An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.

See:

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

query_strings_config

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

See:

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

QueryStringsConfigProperty

class CfnCachePolicyPropsMixin.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 the cache key and 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 the cache key and in requests that CloudFront sends to the origin. Valid values are: - none – No query strings in viewer requests are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to none , any query strings that are listed in an OriginRequestPolicy are included in origin requests. - whitelist – Only the query strings in viewer requests that are listed in the QueryStringNames type are included in the cache key and in requests that CloudFront sends to the origin. - allExcept – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin, except those that are listed in the QueryStringNames type, which are not included. - all – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-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.CfnCachePolicyPropsMixin.QueryStringsConfigProperty(
    query_string_behavior="queryStringBehavior",
    query_strings=["queryStrings"]
)

Attributes

query_string_behavior

Determines whether any URL query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.

Valid values are:

  • none – No query strings in viewer requests are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to none , any query strings that are listed in an OriginRequestPolicy are included in origin requests.

  • whitelist – Only the query strings in viewer requests that are listed in the QueryStringNames type are included in the cache key and in requests that CloudFront sends to the origin.

  • allExcept – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin, except those that are listed in the QueryStringNames type, which are not included.

  • all – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.

See:

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

query_strings

Contains a list of query string names.

See:

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