Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable logging with private s3 bucket #210

Merged
merged 22 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 3 additions & 1 deletion aws-s3-private-bucket/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
locals {
# If grants are defined, we use `grant` to grant permissions, otherwise it will use the `acl` to grant permissions
acl = length(var.grants) == 0 ? "private" : null
private_acl = length(var.grants) == 0 ? "private" : null
log_delivery_write_acl = var.log_delivery_write_acl_enable ? "log-delivery-write" : null
acl = try(coalesce(local.log_delivery_write_acl, local.private_acl), null)

tags = {
project = var.project
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 @@ -68,3 +68,9 @@ variable grants {
default = []
description = "A list of canonical user ID to permissions pairs. Used when we want to grant permissions to AWS accounts via the S3 ACL system."
}

variable log_delivery_write_acl_enable {
type = bool
default = false
description = "Enables logging"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a more descriptive description?

}