Skip to content

Commit 89ec3fd

Browse files
Update s3.tf
1 parent f9fa8d1 commit 89ec3fd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

s3.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,35 @@ resource "aws_s3_bucket_versioning" "this" {
3838
}
3939
}
4040

41+
resource "aws_s3_bucket_versioning" "log_bucket" {
42+
bucket = aws_s3_bucket.log_bucket.id
43+
versioning_configuration {
44+
status = "Enabled"
45+
}
46+
}
47+
4148
resource "aws_s3_bucket" "log_bucket" {
4249
bucket = "log_bucket"
50+
block_public_acls = true
4351
}
4452

4553
resource "aws_s3_bucket_acl" "log_bucket_acl" {
4654
bucket = aws_s3_bucket.log_bucket.id
4755
acl = "log-delivery-write"
4856
}
4957

58+
resource "aws_s3_bucket_server_side_encryption_configuration" "log_bucket" {
59+
bucket = aws_s3_bucket.log_bucket.bucket
60+
61+
rule {
62+
apply_server_side_encryption_by_default {
63+
kms_master_key_id = aws_kms_key.this.arn
64+
sse_algorithm = "aws:kms"
65+
}
66+
}
67+
}
68+
69+
5070
resource "aws_s3_bucket_logging" "this" {
5171
bucket = aws_s3_bucket.this.id
5272

0 commit comments

Comments
 (0)