Skip to content

Commit

Permalink
Criação de variaveis para controle de TTL(Cache)
Browse files Browse the repository at this point in the history
  • Loading branch information
djonathancit committed Mar 31, 2020
1 parent e71fe5e commit aa0cdae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions site-main/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ resource "aws_cloudfront_distribution" "website_cdn" {

trusted_signers = var.trusted_signers

min_ttl = "0"
default_ttl = "300" //3600
max_ttl = "1200" //86400
min_ttl = var.min_ttl
default_ttl = var.default_ttl
max_ttl = var.max_ttl
target_origin_id = "origin-bucket-${aws_s3_bucket.website_bucket.id}"

// This redirects any HTTP request to HTTPS. Security first!
Expand Down
15 changes: 15 additions & 0 deletions site-main/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ variable "price_class" {
description = "CloudFront price class"
default = "PriceClass_200"
}

variable "min_ttl" {
description = "CloudFront minumun TTl"
default = "0"
}

variable "default_ttl" {
description = "CloudFront default TTl"
default = "300"
}

variable "max_ttl" {
description = "CloudFront maximum TTl"
default = "1200"
}

0 comments on commit aa0cdae

Please sign in to comment.