Skip to content

Commit

Permalink
remove cloudwatch logs
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <[email protected]>
  • Loading branch information
Jacob Woffenden committed Nov 13, 2023
1 parent b809bf9 commit c5fbf5c
Showing 1 changed file with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,32 @@ resource "aws_cloudwatch_event_bus" "this" {
event_source_name = data.aws_cloudwatch_event_source.this.name
}

resource "aws_cloudwatch_log_group" "this" {
name = local.cloudwatch_log_group_name
# resource "aws_cloudwatch_log_group" "this" {
# name = local.cloudwatch_log_group_name

kms_key_id = module.kms_key.key_arn
retention_in_days = var.retention_in_days
}
# kms_key_id = module.kms_key.key_arn
# retention_in_days = var.retention_in_days
# }

data "aws_iam_policy_document" "this" {
statement {
actions = [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch"
]
principals {
type = "Service"
identifiers = ["events.amazonaws.com", "delivery.logs.amazonaws.com"]
}
resources = ["${aws_cloudwatch_log_group.this.arn}:*"]
}
}
# data "aws_iam_policy_document" "this" {
# statement {
# actions = [
# "logs:CreateLogStream",
# "logs:PutLogEvents",
# "logs:PutLogEventsBatch"
# ]
# principals {
# type = "Service"
# identifiers = ["events.amazonaws.com", "delivery.logs.amazonaws.com"]
# }
# resources = ["${aws_cloudwatch_log_group.this.arn}:*"]
# }
# }

resource "aws_cloudwatch_log_resource_policy" "this" {
policy_name = "events-to-cloudwatch-logs"
policy_document = data.aws_iam_policy_document.this.json
}
# resource "aws_cloudwatch_log_resource_policy" "this" {
# policy_name = "events-to-cloudwatch-logs"
# policy_document = data.aws_iam_policy_document.this.json
# }

resource "aws_cloudwatch_event_rule" "this" {
name = var.name
Expand All @@ -99,9 +99,9 @@ resource "aws_cloudwatch_event_rule" "this" {
})
}

resource "aws_cloudwatch_event_target" "this" {
target_id = "auth0-to-cloudwatch-logs"
event_bus_name = var.event_source_name
rule = aws_cloudwatch_event_rule.this.name
arn = aws_cloudwatch_log_group.this.arn
}
# resource "aws_cloudwatch_event_target" "this" {
# target_id = "auth0-to-cloudwatch-logs"
# event_bus_name = var.event_source_name
# rule = aws_cloudwatch_event_rule.this.name
# arn = aws_cloudwatch_log_group.this.arn
# }

0 comments on commit c5fbf5c

Please sign in to comment.