Skip to content

Commit

Permalink
feat(config): allow to configure cache TTL times
Browse files Browse the repository at this point in the history
  • Loading branch information
jindrichskupa committed Sep 24, 2024
1 parent eb2cb0d commit 4189237
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ resource "aws_cloudfront_distribution" "this" {
}

viewer_protocol_policy = "redirect-to-https"
min_ttl = 0
default_ttl = 3600
max_ttl = 86400
min_ttl = var.min_ttl
default_ttl = var.default_ttl
max_ttl = var.max_ttl

dynamic "function_association" {
for_each = concat(
Expand Down
15 changes: 15 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,18 @@ variable "origin_path" {
default = ""
description = "Cloudfront origin path"
}

variable "min_ttl" {
type = number
default = 0
}

variable "default_ttl" {
type = number
default = 3600
}

variable "max_ttl" {
type = number
default = 86400
}

0 comments on commit 4189237

Please sign in to comment.