From 50381154b2fda1877a8cf6c7e4f7a4889e211161 Mon Sep 17 00:00:00 2001 From: Julian Nonino Date: Sun, 17 Mar 2024 13:38:24 +0000 Subject: [PATCH] Remove deprecate is_enabled variable. Use state instead (#33) --- main.tf | 2 +- variables.tf | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.tf b/main.tf index 45c9175..c174672 100644 --- a/main.tf +++ b/main.tf @@ -54,7 +54,7 @@ resource "aws_cloudwatch_event_rule" "event_rule" { event_pattern = var.event_rule_event_pattern description = var.event_rule_description role_arn = var.event_rule_role_arn == null ? aws_iam_role.scheduled_task_cw_event_role[0].arn : var.event_rule_role_arn - is_enabled = var.event_rule_is_enabled + state = var.event_rule_state tags = { Name = "${var.name_prefix}-cw-event-rule" } diff --git a/variables.tf b/variables.tf index 2db652f..72d4c8d 100644 --- a/variables.tf +++ b/variables.tf @@ -44,10 +44,10 @@ variable "event_rule_role_arn" { type = string } -variable "event_rule_is_enabled" { - description = "(Optional) Whether the rule should be enabled (defaults to true)." - default = true - type = bool +variable "event_rule_state" { + description = "(Optional) State of the rule. Valid values are DISABLED, ENABLED, and ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS. When state is ENABLED, the rule is enabled for all events except those delivered by CloudTrail. To also enable the rule for events delivered by CloudTrail, set state to ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS. Defaults to ENABLED." + default = "ENABLED" + type = string } #------------------------------------------------------------------------------