Error: "event_pattern" cannot be longer than 2048 characters:

I am creating cloudwatch using below terraform code.

resource "aws_cloudwatch_event_rule" "failed_event" {
 name        = "failed-event"
description = "failed event"


event_pattern = <<PATTERN
{
"source": [
"aws.glue"
 ],
"detail-type": [
"Glue Job State Change"
 ],
 "detail": {
  "state": [
  "FAILED"
   ],
  "jobName": ["${join("\",\"", aws_glue_job.*.name)}"]
  }
  }
 PATTERN
 }

Initially it was working fine. but when the list of glue job reached to its max it is throwing error.
Error: “event_pattern” cannot be longer than 2048 characters

Is there any other way to do this?

@ vickymca2005 please how did you resolve this issue, am currently faced with similar bug, thanks

This topic was automatically closed after 10 days. New replies are no longer allowed.