From d3dc051230c5e7458c05dacb6d2ae71053efce36 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Fri, 7 Jun 2024 10:06:06 +0100 Subject: [PATCH] Fix ECS scheduled task event target role arn * The role index is the computed key, rather than the container name --- ecs-cluster-infrastructure-service-scheduled-task.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecs-cluster-infrastructure-service-scheduled-task.tf b/ecs-cluster-infrastructure-service-scheduled-task.tf index 80cd024..e9490ec 100644 --- a/ecs-cluster-infrastructure-service-scheduled-task.tf +++ b/ecs-cluster-infrastructure-service-scheduled-task.tf @@ -182,7 +182,7 @@ resource "aws_cloudwatch_event_target" "infrastructure_ecs_cluster_service_sched target_id = "${local.resource_prefix}-${each.value["container_name"]}-${each.value["scheduled_task_name"]}" rule = aws_cloudwatch_event_rule.infrastructure_ecs_cluster_service_scheduled_task[each.key].name arn = aws_ecs_cluster.infrastructure[0].arn - role_arn = aws_iam_role.infrastructure_ecs_cluster_service_scheduled_task[each.value["container_name"]].arn + role_arn = aws_iam_role.infrastructure_ecs_cluster_service_scheduled_task[each.key].arn input = jsonencode({}) ecs_target {