Skip to content

Commit

Permalink
Omit remove_headers_config if no headers to remove (#5)
Browse files Browse the repository at this point in the history
Fix permanent diff
  • Loading branch information
lawliet89 authored Mar 22, 2024
1 parent 9d8084d commit 8484bf8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions modules/response-headers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ resource "aws_cloudfront_response_headers_policy" "this" {
}
}

remove_headers_config {
dynamic "items" {
for_each = var.remove_headers
dynamic "remove_headers_config" {
for_each = length(var.remove_headers) > 0 ? [1] : []

content {
header = items.value
content {
dynamic "items" {
for_each = var.remove_headers

content {
header = items.value
}
}
}
}
Expand Down

0 comments on commit 8484bf8

Please sign in to comment.