diff --git a/CHANGELOG.md b/CHANGELOG.md index e44b42a..d539930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [3.3.0](https://github.com/terraform-aws-modules/terraform-aws-eventbridge/compare/v3.2.4...v3.3.0) (2024-04-23) + + +### Features + +* Replace deprecated is_enabled with state in EventBridge rules ([#119](https://github.com/terraform-aws-modules/terraform-aws-eventbridge/issues/119)) ([920138a](https://github.com/terraform-aws-modules/terraform-aws-eventbridge/commit/920138a97e88e1c89f2439c737e17060a23f64de)) + ## [3.2.4](https://github.com/terraform-aws-modules/terraform-aws-eventbridge/compare/v3.2.3...v3.2.4) (2024-04-05) 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