Skip to content

Commit

Permalink
add event target bus name
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-whitwell committed Dec 18, 2024
1 parent 971371d commit 58426c5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions terraform/environment/region/modules/event_bus/bus.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resource "aws_cloudwatch_event_rule" "receive_events_from_mlpa" {
}

resource "aws_cloudwatch_event_bus_policy" "cross_account_receive" {
count = length(var.receive_account_ids) > 0 ? 1 : 0
count = length(var.receive_account_ids) > 0 && var.event_bus_enabled ? 1 : 0
event_bus_name = aws_cloudwatch_event_bus.main[0].name
policy = data.aws_iam_policy_document.cross_account_receive[0].json
provider = aws.region
Expand All @@ -54,7 +54,13 @@ data "aws_iam_policy_document" "cross_account_receive" {
}

resource "aws_cloudwatch_event_target" "receive_events" {
count = var.event_bus_enabled ? 1 : 0
rule = aws_cloudwatch_event_rule.receive_events_from_mlpa[0].name
arn = aws_sqs_queue.receive_events_queue[0].arn
count = var.event_bus_enabled ? 1 : 0
rule = aws_cloudwatch_event_rule.receive_events_from_mlpa[0].name
arn = aws_sqs_queue.receive_events_queue[0].arn
event_bus_name = aws_cloudwatch_event_bus.main[0].name
dead_letter_config {
arn = aws_sqs_queue.receive_events_deadletter[0].arn
}

provider = aws.region
}

0 comments on commit 58426c5

Please sign in to comment.