Skip to content

Commit

Permalink
fix: Custom error responses
Browse files Browse the repository at this point in the history
fixes breaking change by making custom error reponses optional as they should
  • Loading branch information
coolapso committed Jun 10, 2024
1 parent aa89e40 commit 3d0bb5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ No modules.
| <a name="input_cloudfront_origin_description"></a> [cloudfront\_origin\_description](#input\_cloudfront\_origin\_description) | Description for the origin | `string` | n/a | yes |
| <a name="input_cloudfront_origin_name"></a> [cloudfront\_origin\_name](#input\_cloudfront\_origin\_name) | The name of the cloudfront origin | `string` | n/a | yes |
| <a name="input_cookies_forward"></a> [cookies\_forward](#input\_cookies\_forward) | cookies forwarding | `string` | `"none"` | no |
| <a name="input_custom_error_responses"></a> [custom\_error\_responses](#input\_custom\_error\_responses) | Custom error response definitions | <pre>list(object({<br> error_caching_min_ttl = optional(number)<br> error_code = optional(number)<br> response_code = optional(number)<br> response_page_path = optional(string)<br> }))</pre> | n/a | yes |
| <a name="input_custom_error_responses"></a> [custom\_error\_responses](#input\_custom\_error\_responses) | Custom error response definitions | <pre>list(object({<br> error_caching_min_ttl = optional(number)<br> error_code = optional(number)<br> response_code = optional(number)<br> response_page_path = optional(string)<br> }))</pre> | `null` | no |
| <a name="input_default_root_object"></a> [default\_root\_object](#input\_default\_root\_object) | The default website root object | `string` | `null` | no |
| <a name="input_default_ttl"></a> [default\_ttl](#input\_default\_ttl) | Default cache ttl | `number` | `1800` | no |
| <a name="input_enable_distribution"></a> [enable\_distribution](#input\_enable\_distribution) | Enables the cf distributuion | `bool` | `true` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ resource "aws_cloudfront_distribution" "this" {
}

dynamic "custom_error_response" {
for_each = var.custom_error_responses
for_each = var.custom_error_responses != null ? var.custom_error_responses : []

content {
error_caching_min_ttl = var.custom_error_responses[custom_error_response.key].error_caching_min_ttl
Expand Down
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ variable "custom_error_responses" {
response_code = optional(number)
response_page_path = optional(string)
}))
default = null
}

variable "acm_certificate_arn" {
Expand Down

0 comments on commit 3d0bb5e

Please sign in to comment.