Skip to content

Latest commit

 

History

History

cache-policy

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

cache-policy

This module creates following resources.

  • aws_cloudfront_cache_policy

Requirements

Name Version
terraform >= 1.6
aws >= 5.19

Providers

Name Version
aws 5.28.0

Modules

No modules.

Resources

Name Type
aws_cloudfront_cache_policy.this resource

Inputs

Name Description Type Default Required
name (Required) A unique name to identify the CloudFront Cache Policy. string n/a yes
cache_keys_in_cookies (Optional) A configuration for specifying which cookies to use as cache key in viewer requests. The values in the cache key are automatically forwarded in requests to the origin. cache_keys_in_cookies as defined below.
(Required) behavior - Determine whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin. Valid values are NONE, WHITELIST, BLACKLIST, ALL. Defaults to NONE.
(Optional) items - A list of cookie names. It only takes effect when behavior is WHITELIST or BLACKLIST.
object({
behavior = optional(string, "NONE")
items = optional(set(string), [])
})
{} no
cache_keys_in_headers (Optional) A configuration for specifying which headers to use as cache key in viewer requests. The values in the cache key are automatically forwarded in requests to the origin. cache_keys_in_headers as defined below.
(Required) behavior - Determine whether any headers in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin. Valid values are NONE, WHITELIST. Defaults to NONE.
(Optional) items - A list of header names. It only takes effect when behavior is WHITELIST.
object({
behavior = optional(string, "NONE")
items = optional(set(string), [])
})
{} no
cache_keys_in_query_strings (Optional) A configuration for specifying which query strings to use as cache key in viewer requests. The values in the cache key are automatically forwarded in requests to the origin. cache_keys_in_query_strings as defined below.
(Required) behavior - Determine whether any query strings in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin. Valid values are NONE, WHITELIST, BLACKLIST, ALL. Defaults to NONE.
(Optional) items - A list of query string names. It only takes effect when behavior is WHITELIST or BLACKLIST.
object({
behavior = optional(string, "NONE")
items = optional(set(string), [])
})
{} no
default_ttl (Optional) The default time to live in seconds. The amount of time is that you want objects to stay in the CloudFront cache before another request to the origin to see if the object has been updated. Defaults to 86400 (one day). number 86400 no
description (Optional) The description of the cache policy. string "Managed by Terraform." no
max_ttl (Optional) The maximum time to live in seconds. The amount of time is that you want objects to stay in the CloudFront cache before another request to the origin to see if the object has been updated. Defaults to 31536000 (one year). number 31536000 no
min_ttl (Optional) The minimum time to live in seconds. The amount of time is that you want objects to stay in the CloudFront cache before another request to the origin to see if the object has been updated. Defaults to 1. number 1 no
supported_compression_formats (Optional) A list of compression formats to enable CloudFront to request and cache objects that are compressed in these compression formats, when the viewer supports it. These setting also allow CloudFront's automatic compression to work. Valid values are BROTLI and GZIP. set(string)
[
"BROTLI",
"GZIP"
]
no

Outputs

Name Description
cache_keys_in_cookies A configuration for specifying which cookies to use as cache key in viewer requests.
cache_keys_in_headers A configuration for specifying which headers to use as cache key in viewer requests.
cache_keys_in_query_strings A configuration for specifying which query strings to use as cache key in viewer requests.
default_ttl The default time to live in seconds.
description The description of the cache policy.
etag The current version of the cache policy.
id The identifier for the CloudFront cache policy.
max_ttl The maximum time to live in seconds.
min_ttl The minimum time to live in seconds.
name The name of the CloudFront cache policy.
supported_compression_formats The list of compression formats to enable CloudFront to request and cache objects that are compressed in these compression formats, when the viewer supports it