Skip to content

Commit

Permalink
Merge pull request #19 from terraform-modules/access-logging
Browse files Browse the repository at this point in the history
add access-logging
  • Loading branch information
badra001 committed Jul 29, 2020
2 parents 105f964 + e53f325 commit 375e89b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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"
}

0 comments on commit 375e89b

Please sign in to comment.