Skip to content

Commit

Permalink
Adds cloudfront logging feature
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Diniz <[email protected]>
  • Loading branch information
arthurbdiniz committed Feb 26, 2020
1 parent bc8d84c commit d06ba37
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
variable "name" {}

variable "s3_bucket_id" {}

variable "hostnames" {
type = "list"
}

variable "hosted_zone" {}

variable "certificate_arn" {}

variable "hostname_create" {
description = "Create hostname in the hosted zone passed?"
default = true
}

variable "cloudfront_logging_bucket" {
description = "Bucket to store logs from app"
}

variable "cloudfront_logging_prefix" {
description = "Logging prefix"
}
6 changes: 6 additions & 0 deletions cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ resource "aws_cloudfront_distribution" "default" {
}
}

logging_config {
include_cookies = false
bucket = "${var.cloudfront_logging_bucket}"
prefix = "${var.cloudfront_logging_prefix}"
}

default_cache_behavior {
allowed_methods = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
cached_methods = ["GET", "HEAD"]
Expand Down

0 comments on commit d06ba37

Please sign in to comment.