File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ resource "aws_s3_bucket" "this" {
3
3
bucket = var. project_name
4
4
policy = data. aws_iam_policy_document . this . json
5
5
6
+ block_public_acls = true
7
+
6
8
website {
7
9
redirect_all_requests_to = " https://${ var . target_domain } "
8
10
}
@@ -39,3 +41,42 @@ data "aws_iam_policy_document" "this" {
39
41
40
42
version = " 2012-10-17"
41
43
}
44
+
45
+ resource "aws_kms_key" "this" {
46
+ deletion_window_in_days = 10
47
+ }
48
+
49
+ resource "aws_s3_bucket_server_side_encryption_configuration" "this" {
50
+ bucket = aws_s3_bucket. this . bucket
51
+
52
+ rule {
53
+ apply_server_side_encryption_by_default {
54
+ kms_master_key_id = aws_kms_key. this . arn
55
+ sse_algorithm = " aws:kms"
56
+ }
57
+ }
58
+ }
59
+
60
+
61
+ resource "aws_s3_bucket_versioning" "this" {
62
+ bucket = aws_s3_bucket. this . id
63
+ versioning_configuration {
64
+ status = " Enabled"
65
+ }
66
+ }
67
+
68
+ resource "aws_s3_bucket" "log_bucket" {
69
+ bucket = " log_bucket"
70
+ }
71
+
72
+ resource "aws_s3_bucket_acl" "log_bucket_acl" {
73
+ bucket = aws_s3_bucket. log_bucket . id
74
+ acl = " log-delivery-write"
75
+ }
76
+
77
+ resource "aws_s3_bucket_logging" "this" {
78
+ bucket = aws_s3_bucket. this . id
79
+
80
+ target_bucket = aws_s3_bucket. log_bucket . id
81
+ target_prefix = " log/"
82
+ }
You can’t perform that action at this time.
0 commit comments