-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.tf
More file actions
26 lines (22 loc) · 774 Bytes
/
events.tf
File metadata and controls
26 lines (22 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
locals {
events = merge([for cp in local.cap_modules : { for i, event in lookup(cp.outputs, "events", []) : "cap_${cp.tfId}_${i}" => event }]...)
}
resource "aws_cloudwatch_event_target" "this" {
for_each = local.events
rule = each.value.rule_name
role_arn = each.value.role_arn
arn = local.cluster_arn
input = each.value.input
ecs_target {
tags = local.tags
task_count = 1
task_definition_arn = aws_ecs_task_definition.this.arn
launch_type = "EC2"
enable_execute_command = true
network_configuration {
subnets = local.private_subnet_ids
assign_public_ip = false
security_groups = [aws_security_group.this.id]
}
}
}