Skip to content

Commit

Permalink
Initial updates for supporting s3 bucket logging targets. (#302)
Browse files Browse the repository at this point in the history
* Support s3 bucket logging targets.
  • Loading branch information
jgadling authored Apr 15, 2021
1 parent 83e12bc commit c0c5731
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 7 additions & 5 deletions aws-s3-private-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ resource "aws_s3_bucket" "bucket" {
}
}

# TODO
# logging {
# target_bucket = ""
# target_prefix = ""
# }
dynamic "logging" {
for_each = var.logging_bucket == null ? [] : [var.logging_bucket]
content {
target_bucket = var.logging_bucket.name
target_prefix = var.logging_bucket.prefix
}
}

server_side_encryption_configuration {
rule {
Expand Down
6 changes: 6 additions & 0 deletions aws-s3-private-bucket/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ variable "transfer_acceleration" {
default = false
}

variable "logging_bucket" {
type = object({ name = string, prefix = string })
description = "Log bucket name and prefix to enable logs for this bucket"
default = null
}

variable "public_access_block" {
type = bool
default = true
Expand Down

0 comments on commit c0c5731

Please sign in to comment.