diff --git a/main.tf b/main.tf index 10e4aa3..1270098 100644 --- a/main.tf +++ b/main.tf @@ -88,11 +88,10 @@ resource "aws_cloudwatch_event_rule" "this" { event_bus_name = var.create_bus ? aws_cloudwatch_event_bus.this[0].name : var.bus_name description = lookup(each.value, "description", null) - is_enabled = lookup(each.value, "enabled", null) event_pattern = lookup(each.value, "event_pattern", null) schedule_expression = lookup(each.value, "schedule_expression", null) role_arn = lookup(each.value, "role_arn", false) ? aws_iam_role.eventbridge[0].arn : null - state = lookup(each.value, "state", null) + state = try(each.value.enabled ? "ENABLED" : "DISABLED", tobool(each.value.state) ? "ENABLED" : "DISABLED", upper(each.value.state), "DISABLED") tags = merge(var.tags, { Name = each.value.Name