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 1 commit
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
acl = length(var.grants) == 0 ? "private" : (
var.log_delivery_write_acl_enable ? "log-delivery-write" : null
Copy link
Contributor

Choose a reason for hiding this comment

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

Think this needs a fix -- the log delivery flag will only work here if we have grants AND log_delivery_write_acl_enable set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

redid, but had to put in a try because hashicorp/terraform#25014

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did find this: hashicorp/terraform#22131 (comment), which is what I had previously.

)

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 = true
alldoami marked this conversation as resolved.
Show resolved Hide resolved
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?

}