Skip to content

Commit fbc0bcc

Browse files
committed
fix(response-headers-policy): no define remove_headers_config block if var.remove_headers is empty
1 parent f2801a1 commit fbc0bcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/response-headers-policy/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ output "custom_headers" {
3030

3131
output "remove_headers" {
3232
description = "A set of HTTP headers to remove from the response headers."
33-
value = toset(aws_cloudfront_response_headers_policy.this.remove_headers_config[0].items != null
33+
value = (one(aws_cloudfront_response_headers_policy.this.remove_headers_config) != null
3434
? [
35-
for item in aws_cloudfront_response_headers_policy.this.remove_headers_config[0].items :
35+
for item in one(aws_cloudfront_response_headers_policy.this.remove_headers_config[*].items) :
3636
item.header
3737
]
3838
: []

0 commit comments

Comments
 (0)