Skip to content

Commit 0945c77

Browse files
authored
fix: Updated handling of one or many custom_error_response values (#89)
1 parent d5397b3 commit 0945c77

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

examples/complete/main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ module "cloudfront" {
140140
ssl_support_method = "sni-only"
141141
}
142142

143+
custom_error_response = {
144+
error_code = 404
145+
response_page_path = "/errors/404.html"
146+
}
147+
143148
geo_restriction = {
144149
restriction_type = "whitelist"
145150
locations = ["NO", "UA", "US", "GB"]

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ resource "aws_cloudfront_distribution" "this" {
246246
}
247247

248248
dynamic "custom_error_response" {
249-
for_each = var.custom_error_response
249+
for_each = flatten([var.custom_error_response])
250250

251251
content {
252252
error_code = custom_error_response.value["error_code"]

0 commit comments

Comments
 (0)