Skip to content

Commit 47660d2

Browse files
committed
Added cache control
1 parent e2f5f87 commit 47660d2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resource "aws_s3_bucket_object" "this" {
22
for_each = fileset(var.file_path, "**")
33

44
content_type = lookup(jsondecode(file("${path.module}/src/mime.json")), regex("\\.[^.]+$", each.value), null)
5+
cache_control = var.cache_control
56
acl = var.acl
67
bucket = var.bucket_id
78
storage_class = var.storage_class

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ variable "storage_class" {
1818
type = string
1919
default = "STANDARD"
2020
description = "The object storage class to use for this site, defaults to STANDARD"
21+
}
22+
23+
variable "cache_control" {
24+
type = string
25+
default = "max-age=1440"
26+
description = "The header to use for cache control"
2127
}

0 commit comments

Comments
 (0)