File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,13 @@ module "cloudfront" {
140140 ssl_support_method = " sni-only"
141141 }
142142
143- custom_error_response = {
143+ custom_error_response = [ {
144144 error_code = 404
145145 response_page_path = " /errors/404.html"
146- }
146+ }, {
147+ error_code = 403
148+ response_page_path = " /errors/403.html"
149+ }]
147150
148151 geo_restriction = {
149152 restriction_type = " whitelist"
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ resource "aws_cloudfront_distribution" "this" {
246246 }
247247
248248 dynamic "custom_error_response" {
249- for_each = flatten ([var . custom_error_response ])
249+ for_each = length ( flatten ([var . custom_error_response ])[ 0 ]) > 0 ? flatten ([ var . custom_error_response ]) : []
250250
251251 content {
252252 error_code = custom_error_response. value [" error_code" ]
You can’t perform that action at this time.
0 commit comments