Skip to content

Commit

Permalink
feat: Replace deprecated is_enabled with state in EventBridge rules (#…
Browse files Browse the repository at this point in the history
…119)

* feat: Fixed is_enabled deprecated usage

* feat: Fixed is_enabled deprecated usage

* Update main.tf

Co-authored-by: Anton Babenko <anton@antonbabenko.com>

* Update main.tf

---------

Co-authored-by: Josh Sternfeld <josh.sternfeld@wnco.com>
Co-authored-by: Anton Babenko <anton@antonbabenko.com>
  • Loading branch information
3 people committed Apr 23, 2024
1 parent ed78efe commit 920138a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 920138a

Please sign in to comment.