Skip to content

Commit 920138a

Browse files
hammy414Josh Sternfeldantonbabenko
authored
feat: Replace deprecated is_enabled with state in EventBridge rules (#119)
* feat: Fixed is_enabled deprecated usage * feat: Fixed is_enabled deprecated usage * Update main.tf Co-authored-by: Anton Babenko <[email protected]> * Update main.tf --------- Co-authored-by: Josh Sternfeld <[email protected]> Co-authored-by: Anton Babenko <[email protected]>
1 parent ed78efe commit 920138a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ resource "aws_cloudwatch_event_rule" "this" {
8888
event_bus_name = var.create_bus ? aws_cloudwatch_event_bus.this[0].name : var.bus_name
8989

9090
description = lookup(each.value, "description", null)
91-
is_enabled = lookup(each.value, "enabled", null)
9291
event_pattern = lookup(each.value, "event_pattern", null)
9392
schedule_expression = lookup(each.value, "schedule_expression", null)
9493
role_arn = lookup(each.value, "role_arn", false) ? aws_iam_role.eventbridge[0].arn : null
95-
state = lookup(each.value, "state", null)
94+
state = try(each.value.enabled ? "ENABLED" : "DISABLED", tobool(each.value.state) ? "ENABLED" : "DISABLED", upper(each.value.state), "DISABLED")
9695

9796
tags = merge(var.tags, {
9897
Name = each.value.Name

0 commit comments

Comments
 (0)