File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,17 @@ resource "aws_cloudfront_distribution" "cdn" {
11
11
comment = var. comment
12
12
default_root_object = var. index_document_default
13
13
14
+
15
+ dynamic "custom_error_response" {
16
+ for_each = var. cloudfront_custom_errors
17
+ content {
18
+ error_caching_min_ttl = custom_error_response. value [" error_caching_min_ttl" ]
19
+ error_code = custom_error_response. value [" error_code" ]
20
+ response_code = custom_error_response. value [" response_code" ]
21
+ response_page_path = custom_error_response. value [" response_page_path" ]
22
+ }
23
+ }
24
+
14
25
default_cache_behavior {
15
26
allowed_methods = var. cloudfront_allowed_methods
16
27
cached_methods = var. cloudfront_cached_methods
Original file line number Diff line number Diff line change @@ -54,6 +54,16 @@ variable "url" {
54
54
description = " The custom URL to access the site. Must match the certificate name to provide a valid TLS connection."
55
55
}
56
56
57
+ variable cloudfront_custom_errors {
58
+ description = " A map of custom error settings for the CloudFront Distribution"
59
+ type = list (object ({
60
+ error_caching_min_ttl = number
61
+ error_code = number
62
+ response_code = number
63
+ response_page_path = string
64
+ }))
65
+ default = []
66
+ }
57
67
variable "cloudfront_allowed_methods" {
58
68
description = " Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin."
59
69
type = list (string )
You can’t perform that action at this time.
0 commit comments