Skip to content

Commit e8b9836

Browse files
committed
CCM-13146 remove the cloudwatch log resource policy
1 parent 46e18ee commit e8b9836

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

infrastructure/terraform/components/dl/cloudwatch_log_group_event_bus.tf

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,42 @@ resource "aws_cloudwatch_log_group" "event_bus" {
44
kms_key_id = module.kms.key_arn
55
}
66

7-
resource "aws_cloudwatch_log_resource_policy" "event_bus" {
8-
policy_document = data.aws_iam_policy_document.event_bus_logs.json
9-
policy_name = "AWSLogDeliveryWrite-${aws_cloudwatch_event_bus.main.name}"
10-
}
7+
# resource "aws_cloudwatch_log_resource_policy" "event_bus" {
8+
# policy_document = data.aws_iam_policy_document.event_bus_logs.json
9+
# policy_name = "AWSLogDeliveryWrite-${aws_cloudwatch_event_bus.main.name}"
10+
# }
1111

12-
data "aws_iam_policy_document" "event_bus_logs" {
13-
statement {
14-
effect = "Allow"
15-
principals {
16-
type = "Service"
17-
identifiers = ["delivery.logs.amazonaws.com"]
18-
}
19-
actions = [
20-
"logs:CreateLogStream",
21-
"logs:PutLogEvents"
22-
]
23-
resources = [
24-
"${aws_cloudwatch_log_group.event_bus.arn}:log-stream:*"
25-
]
26-
condition {
27-
test = "StringEquals"
28-
variable = "aws:SourceAccount"
29-
values = [var.aws_account_id]
30-
}
31-
condition {
32-
test = "ArnLike"
33-
variable = "aws:SourceArn"
34-
values = [
35-
aws_cloudwatch_log_delivery_source.main_info_logs.arn,
36-
aws_cloudwatch_log_delivery_source.main_error_logs.arn,
37-
aws_cloudwatch_log_delivery_source.main_trace_logs.arn
38-
]
39-
}
40-
}
41-
}
12+
# data "aws_iam_policy_document" "event_bus_logs" {
13+
# statement {
14+
# effect = "Allow"
15+
# principals {
16+
# type = "Service"
17+
# identifiers = [
18+
# "delivery.logs.amazonaws.com",
19+
# "events.amazonaws.com"
20+
# ]
21+
# }
22+
# actions = [
23+
# "logs:CreateLogStream",
24+
# "logs:PutLogEvents"
25+
# ]
26+
# resources = [
27+
# aws_cloudwatch_log_group.event_bus.arn,
28+
# "${aws_cloudwatch_log_group.event_bus.arn}:log-stream:*"
29+
# ]
30+
# condition {
31+
# test = "StringEquals"
32+
# variable = "aws:SourceAccount"
33+
# values = [var.aws_account_id]
34+
# }
35+
# condition {
36+
# test = "ArnLike"
37+
# variable = "aws:SourceArn"
38+
# values = [
39+
# aws_cloudwatch_log_delivery_source.main_info_logs.arn,
40+
# aws_cloudwatch_log_delivery_source.main_error_logs.arn,
41+
# aws_cloudwatch_log_delivery_source.main_trace_logs.arn
42+
# ]
43+
# }
44+
# }
45+
# }

0 commit comments

Comments
 (0)