Skip to content

add access-logging #19

Merged
merged 2 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ resource "aws_s3_bucket" "this" {
enabled = true
}

logging {
target_bucket = var.access_log_bucket
target_prefix = format("%s/%s/",var.access_log_bucket_prefix,var.access_log_bucket)
}

lifecycle {
prevent_destroy = true
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ variable "tags" {
type = map(string)
default = { }
}

variable "access_log_bucket_prefix" {
description = "Access log bucket prefix, to which the bucket name will be appended to make the target_prefix"
type = string
default = "s3"
}