Skip to content

Commit

Permalink
add bucket owner to s3-access-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 18, 2022
1 parent f4fb18e commit 0942cb5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@
* v1.14.1 -- 20211126
- cloudltrail
- make multi-region default for org cloudtrail

* v1.14.2 -- 20220118
- s3-access-logs
- set bucket owner to BucketOwnerEnforced
2 changes: 1 addition & 1 deletion common/version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "1.14.1"
_module_version = "1.14.2"
}
1 change: 1 addition & 0 deletions s3-access-logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ No modules.
|------|------|
| [aws_s3_bucket.logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket_object.logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object) | resource |
| [aws_s3_bucket_ownership_controls.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls) | resource |
| [aws_s3_bucket_policy.logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_public_access_block.logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
| [null_resource.policy_delay](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
Expand Down
13 changes: 13 additions & 0 deletions s3-access-logs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,16 @@ resource "null_resource" "policy_delay" {
command = "sleep 120"
}
}

#---
# set ownership controls
# see documentation:
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls
#
resource "aws_s3_bucket_ownership_controls" "this" {
bucket = aws_s3_bucket.this.id

rule {
object_ownership = "BucketOwnerEnforced"
}
}

0 comments on commit 0942cb5

Please sign in to comment.