diff --git a/alarms.tf b/alarms.tf index b236cde022ad49673114714a14c4cb1a491370ed..274ac9a6177f13554482b203293f5d80253191cb 100644 --- a/alarms.tf +++ b/alarms.tf @@ -17,6 +17,10 @@ resource "aws_cloudwatch_metric_alarm" "invocations" { dimensions = { FunctionName = local.function_names[count.index] } + + depends_on = [ + aws_cloudwatch_event_target.schedule, + ] } resource "aws_cloudwatch_metric_alarm" "errors" { @@ -38,4 +42,8 @@ resource "aws_cloudwatch_metric_alarm" "errors" { dimensions = { FunctionName = local.function_names[count.index] } + + depends_on = [ + aws_cloudwatch_event_target.schedule, + ] }