Skip to content

Commit 5a8eddc

Browse files
committed
feat(cache-policy): support aws v6
1 parent 7b9b185 commit 5a8eddc

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

modules/cache-policy/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ This module creates following resources.
99

1010
| Name | Version |
1111
|------|---------|
12-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6 |
13-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.19 |
12+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.12 |
13+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.20 |
1414

1515
## Providers
1616

1717
| Name | Version |
1818
|------|---------|
19-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.28.0 |
19+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 6.23.0 |
2020

2121
## Modules
2222

@@ -33,19 +33,20 @@ No modules.
3333
| Name | Description | Type | Default | Required |
3434
|------|-------------|------|---------|:--------:|
3535
| <a name="input_name"></a> [name](#input\_name) | (Required) A unique name to identify the CloudFront Cache Policy. | `string` | n/a | yes |
36-
| <a name="input_cache_keys_in_cookies"></a> [cache\_keys\_in\_cookies](#input\_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.<br> (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`.<br> (Optional) `items` - A list of cookie names. It only takes effect when `behavior` is `WHITELIST` or `BLACKLIST`. | <pre>object({<br> behavior = optional(string, "NONE")<br> items = optional(set(string), [])<br> })</pre> | `{}` | no |
37-
| <a name="input_cache_keys_in_headers"></a> [cache\_keys\_in\_headers](#input\_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.<br> (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`.<br> (Optional) `items` - A list of header names. It only takes effect when `behavior` is `WHITELIST`. | <pre>object({<br> behavior = optional(string, "NONE")<br> items = optional(set(string), [])<br> })</pre> | `{}` | no |
38-
| <a name="input_cache_keys_in_query_strings"></a> [cache\_keys\_in\_query\_strings](#input\_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.<br> (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`.<br> (Optional) `items` - A list of query string names. It only takes effect when `behavior` is `WHITELIST` or `BLACKLIST`. | <pre>object({<br> behavior = optional(string, "NONE")<br> items = optional(set(string), [])<br> })</pre> | `{}` | no |
36+
| <a name="input_cache_keys_in_cookies"></a> [cache\_keys\_in\_cookies](#input\_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.<br/> (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`.<br/> (Optional) `items` - A list of cookie names. It only takes effect when `behavior` is `WHITELIST` or `BLACKLIST`. | <pre>object({<br/> behavior = optional(string, "NONE")<br/> items = optional(set(string), [])<br/> })</pre> | `{}` | no |
37+
| <a name="input_cache_keys_in_headers"></a> [cache\_keys\_in\_headers](#input\_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.<br/> (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`.<br/> (Optional) `items` - A list of header names. It only takes effect when `behavior` is `WHITELIST`. | <pre>object({<br/> behavior = optional(string, "NONE")<br/> items = optional(set(string), [])<br/> })</pre> | `{}` | no |
38+
| <a name="input_cache_keys_in_query_strings"></a> [cache\_keys\_in\_query\_strings](#input\_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.<br/> (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`.<br/> (Optional) `items` - A list of query string names. It only takes effect when `behavior` is `WHITELIST` or `BLACKLIST`. | <pre>object({<br/> behavior = optional(string, "NONE")<br/> items = optional(set(string), [])<br/> })</pre> | `{}` | no |
3939
| <a name="input_default_ttl"></a> [default\_ttl](#input\_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 |
4040
| <a name="input_description"></a> [description](#input\_description) | (Optional) The description of the cache policy. | `string` | `"Managed by Terraform."` | no |
4141
| <a name="input_max_ttl"></a> [max\_ttl](#input\_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 |
4242
| <a name="input_min_ttl"></a> [min\_ttl](#input\_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 |
43-
| <a name="input_supported_compression_formats"></a> [supported\_compression\_formats](#input\_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)` | <pre>[<br> "BROTLI",<br> "GZIP"<br>]</pre> | no |
43+
| <a name="input_supported_compression_formats"></a> [supported\_compression\_formats](#input\_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)` | <pre>[<br/> "BROTLI",<br/> "GZIP"<br/>]</pre> | no |
4444

4545
## Outputs
4646

4747
| Name | Description |
4848
|------|-------------|
49+
| <a name="output_arn"></a> [arn](#output\_arn) | The ARN of the CloudFront cache policy. |
4950
| <a name="output_cache_keys_in_cookies"></a> [cache\_keys\_in\_cookies](#output\_cache\_keys\_in\_cookies) | A configuration for specifying which cookies to use as cache key in viewer requests. |
5051
| <a name="output_cache_keys_in_headers"></a> [cache\_keys\_in\_headers](#output\_cache\_keys\_in\_headers) | A configuration for specifying which headers to use as cache key in viewer requests. |
5152
| <a name="output_cache_keys_in_query_strings"></a> [cache\_keys\_in\_query\_strings](#output\_cache\_keys\_in\_query\_strings) | A configuration for specifying which query strings to use as cache key in viewer requests. |

modules/cache-policy/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
output "arn" {
2+
description = "The ARN of the CloudFront cache policy."
3+
value = aws_cloudfront_cache_policy.this.arn
4+
}
5+
16
output "id" {
27
description = "The identifier for the CloudFront cache policy."
38
value = aws_cloudfront_cache_policy.this.id

modules/cache-policy/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
variable "name" {
22
description = "(Required) A unique name to identify the CloudFront Cache Policy."
33
type = string
4+
nullable = false
45
}
56

67
variable "description" {

modules/cache-policy/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.6"
2+
required_version = ">= 1.12"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.19"
7+
version = ">= 6.20"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)