Skip to content

Commit

Permalink
Update s3.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
kariemoorman authored Apr 26, 2024
1 parent 02d7fc7 commit fb20d5e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tf/step2_cf_rt53/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ resource "aws_s3_bucket" "log_bucket" {
bucket = "tf-log-bucket"
}

# Create a block public access configuration
resource "aws_s3_bucket_public_access_block" "log_block" {
bucket = aws_s3_bucket.log_bucket.id
ignore_public_acls = true
}

# Add ACL
resource "aws_s3_bucket_acl" "log_bucket_acl" {
bucket = aws_s3_bucket.log_bucket.id
Expand All @@ -73,7 +79,6 @@ resource "aws_s3_bucket_acl" "log_bucket_acl" {
# Add versioning
resource "aws_s3_bucket_versioning" "log_bucket_versioning" {
bucket = aws_s3_bucket.log_bucket.id

versioning_configuration {
status = "Enabled"
}
Expand All @@ -82,7 +87,6 @@ resource "aws_s3_bucket_versioning" "log_bucket_versioning" {
# Add logging
resource "aws_s3_bucket_logging" "s3log" {
bucket = aws_s3_bucket.week1-bucket.id

target_bucket = aws_s3_bucket.log_bucket.id
target_prefix = "log/"
}
Expand Down

0 comments on commit fb20d5e

Please sign in to comment.