Skip to content

Commit 108dfc1

Browse files
committed
CCM-11586: refine logging bucket policies
1 parent 1413b02 commit 108dfc1

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

infrastructure/terraform/components/api/s3_bucket_logging.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ resource "aws_s3_bucket_logging" "truststore" {
4444
bucket = aws_s3_bucket.truststore.id
4545

4646
target_bucket = aws_s3_bucket.logging.bucket
47-
target_prefix = "truststore/${aws_s3_bucket.truststore.bucket}/"
47+
target_prefix = "${aws_s3_bucket.truststore.bucket}/"
4848
}

infrastructure/terraform/components/api/s3_bucket_policy_logging.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,20 @@ data "aws_iam_policy_document" "logging" {
2525
]
2626
}
2727
}
28+
29+
statement {
30+
sid = "s3-log-delivery"
31+
effect = "Allow"
32+
33+
principals {
34+
type = "Service"
35+
identifiers = ["logging.s3.amazonaws.com"]
36+
}
37+
38+
actions = ["s3:PutObject"]
39+
40+
resources = [
41+
"${aws_s3_bucket.logging.arn}/*",
42+
]
43+
}
2844
}

0 commit comments

Comments
 (0)