From af38e9cd237724b417d74377de8f2cf96b5d703d Mon Sep 17 00:00:00 2001 From: Josh Sternfeld Date: Thu, 18 Apr 2024 15:33:44 -0400 Subject: [PATCH 1/4] feat: Fixed is_enabled deprecated usage --- main.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 10e4aa3..2367b77 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 = lookup(each.value, "enabled", null) ? "ENABLED" : "DISABLED" tags = merge(var.tags, { Name = each.value.Name From 6063433cfc06c9ac4cd3c8df7ea9bc49adbd597a Mon Sep 17 00:00:00 2001 From: Josh Sternfeld Date: Thu, 18 Apr 2024 15:48:06 -0400 Subject: [PATCH 2/4] feat: Fixed is_enabled deprecated usage --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 2367b77..ae6469c 100644 --- a/main.tf +++ b/main.tf @@ -91,7 +91,7 @@ resource "aws_cloudwatch_event_rule" "this" { 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, "enabled", null) ? "ENABLED" : "DISABLED" + state = coalesce(lookup(each.value, "enabled", null), false) ? "ENABLED" : "DISABLED" tags = merge(var.tags, { Name = each.value.Name From 1f6a7e4ee4952daa9582afc0b7a9f3ab08e896d4 Mon Sep 17 00:00:00 2001 From: Josh Sternfeld Date: Tue, 23 Apr 2024 12:25:31 -0400 Subject: [PATCH 3/4] Update main.tf Co-authored-by: Anton Babenko --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index ae6469c..2e12158 100644 --- a/main.tf +++ b/main.tf @@ -91,7 +91,7 @@ resource "aws_cloudwatch_event_rule" "this" { 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 = coalesce(lookup(each.value, "enabled", null), false) ? "ENABLED" : "DISABLED" + state = try(each.value.enabled ? "ENABLED" : "DISABLED", tobool(each.value.state) ? "ENABLED" : "DISABLED", "DISABLED") tags = merge(var.tags, { Name = each.value.Name From b20abc9e9085c6ccae6bbd3c00a635042a828012 Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Tue, 23 Apr 2024 18:31:55 +0200 Subject: [PATCH 4/4] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 2e12158..1270098 100644 --- a/main.tf +++ b/main.tf @@ -91,7 +91,7 @@ resource "aws_cloudwatch_event_rule" "this" { 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 = try(each.value.enabled ? "ENABLED" : "DISABLED", tobool(each.value.state) ? "ENABLED" : "DISABLED", "DISABLED") + 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