Skip to content

Commit 46d6fc7

Browse files
committed
Adding response headers policy var
1 parent 286d6d8 commit 46d6fc7

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ resource "aws_cloudfront_distribution" "this" {
203203

204204
aliases = var.source_sub_domain != "" ? ["${var.source_sub_domain}.${var.source_zone_name}"] : [var.source_zone_name]
205205
default_cache_behavior {
206-
allowed_methods = ["GET", "HEAD"]
207-
cached_methods = ["GET", "HEAD"]
208-
target_origin_id = aws_s3_bucket.this.id
206+
allowed_methods = ["GET", "HEAD"]
207+
cached_methods = ["GET", "HEAD"]
208+
target_origin_id = aws_s3_bucket.this.id
209+
response_headers_policy_id = var.response_headers_policy_id
209210

210211
viewer_protocol_policy = "redirect-to-https"
211212
cache_policy_id = "658327ea-f89d-4fab-a63d-7e88639e58f6"

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@ variable "cloudfront_ipv6" {
5959
type = bool
6060
default = true
6161
description = "Should we configure the cloudfront distribution for IPv6?"
62-
}
62+
}
63+
64+
variable "response_headers_policy_id" {
65+
type = string
66+
default = ""
67+
description = "Should we add a response headers policy to the CloudFront distrobution created by this module?"
68+
}

0 commit comments

Comments
 (0)