Skip to content

aws.cloudfront.get_cache_policy_config

Example SQL Queries

SELECT * FROM
aws.cloudfront.get_cache_policy_config
WHERE
"id" = 'VALUE';

Description

Gets a cache policy configuration.

To get a cache policy configuration, you must provide the policy's identifier. If the cache policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the cache policy is not attached to a cache behavior, you can get the identifier using ListCachePolicies.

Table Definition

Column NameColumn Data Type
id Required Input Column

The unique identifier for the cache policy. If the cache policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the cache policy is not attached to a cache behavior, you can get the identifier using ListCachePolicies.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

cache_policy_config

The cache policy configuration.

STRUCT(
"comment" VARCHAR,
"name" VARCHAR,
"default_ttl" BIGINT,
"max_ttl" BIGINT,
"min_ttl" BIGINT,
"parameters_in_cache_key_and_forwarded_to_origin" STRUCT(
"enable_accept_encoding_gzip" BOOLEAN,
"enable_accept_encoding_brotli" BOOLEAN,
"headers_config" STRUCT(
"header_behavior" VARCHAR,
"headers" STRUCT(
"quantity" BIGINT,
"items" VARCHAR[]
)
),
"cookies_config" STRUCT(
"cookie_behavior" VARCHAR,
"cookies" STRUCT(
"quantity" BIGINT,
"items" VARCHAR[]
)
),
"query_strings_config" STRUCT(
"query_string_behavior" VARCHAR,
"query_strings" STRUCT(
"quantity" BIGINT,
"items" VARCHAR[]
)
)
)
)
Show child fields
cache_policy_config.comment

A comment to describe the cache policy. The comment cannot be longer than 128 characters.

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

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

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

cache_policy_config.name

A unique name to identify the cache policy.

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

Show child fields
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.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.

Show child fields
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.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.

cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies

Contains a list of cookie names.

Show child fields
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.items[]
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.cookies_config.cookies.quantity

The number of cookie names in the Items list.

cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.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.

cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.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.

cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.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.

Show child fields
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.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.

cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers

Contains a list of HTTP header names.

Show child fields
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.items[]
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.headers_config.headers.quantity

The number of header names in the Items list.

cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.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.

Show child fields
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.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.

cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings

Contains the specific query strings in viewer requests that either are or are not included in the cache key and in requests that CloudFront sends to the origin. The behavior depends on whether the QueryStringBehavior field in the CachePolicyQueryStringsConfig type is set to whitelist (the listed query strings are included) or allExcept (the listed query strings are not included, but all other query strings are).

Show child fields
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.items[]
cache_policy_config.parameters_in_cache_key_and_forwarded_to_origin.query_strings_config.query_strings.quantity

The number of query string names in the Items list.

e_tag

The current version of the cache policy.

VARCHAR