Even though we have only 73 event bridge rules in one region, during TF apply it throws LimitExceededException: The requested resource exceeds the maximum number allowed for AWS , although the max number rules that can be defined in a given region is 300 eb-quota.
Snippet of code for creating EB rule:
resource "aws_cloudwatch_event_rule" "testing" {
count = var.some_condition ? 1 : 0
name = var.resource_name
event_pattern = jsonencode({
"detail" = {
"requestParameters" = {
"key" = [for val in var.my_list : { wildcard = "${val["v1"]}/*/*${val["v2"]}" }]
}
}
})
}
Where my_list is :
my_list = [
{
"v1" = "myV1"
"v2" = "myV2"
}
]