title: AWS Cloudwatch alarm not provisioned correctly. Am I not referencing the log group to filter on correctly?
body: <p>I am trying to provision in terraform a cloudwatch alarm to trigger on a keyword string printed from a lambda. I can confirm the lambda runs and prints the message for testing purposes. I have confirmed via terminal commands that the cloudwatch alarm exists, but in an insufficient data state. the lambda log group name is &quot;/aws/lambda/error-test-lambda&quot;, and I confirmed that test messages are printing successfully.</p>
  <pre><code>resource &quot;aws_cloudwatch_metric_alarm&quot; &quot;error-we-care-about-alarm&quot; {
      alarm_name          = &quot;error-we-care-about&quot;
      metric_name         = aws_cloudwatch_log_metric_filter.error-we-care-about-metric-filter.name
      threshold           = 0
      statistic           = &quot;Sum&quot;
      comparison_operator = &quot;GreaterThanThreshold&quot;
      datapoints_to_alarm = &quot;1&quot;
      evaluation_periods  = &quot;1&quot;
      period              = 60
      namespace           = &quot;IncomingLogEvents&quot;
      actions_enabled     = &quot;true&quot;
      alarm_description   = &quot;This metric monitors  API call errors&quot;
  }
  
  resource &quot;aws_cloudwatch_log_group&quot; &quot;lamba_test_cloudwatch_logs&quot;{
    name = &quot;/aws/lambda/local-error-test&quot;   
  }
  
  resource &quot;aws_cloudwatch_log_metric_filter&quot; &quot;error-we-care-about-metric-filter&quot;{
    name            = &quot;MyErrorFilter-we-care-about&quot;
    log_group_name  = aws_cloudwatch_log_group.lamba_test_cloudwatch_logs.name
    pattern         = &quot;HIPPOPOTAMUS&quot;
  
    metric_transformation {
      # increment threshold of aws_cloudwatch_metric_alarm 
      name        = &quot;errors-found-alarm&quot;
      namespace   = &quot;mycloudwatchalarmtest&quot;
      value       = 1
    }
  }
  </code></pre>