From 3e6f42fc46db2b97d2a99bf566583f01aaeb01d9 Mon Sep 17 00:00:00 2001 From: Stefan Freitag Date: Fri, 26 Apr 2024 22:15:19 +0200 Subject: [PATCH] feat: replace deprecated is_enabled --- main.tf | 2 +- tests/defaults.tftest.hcl | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 388ad3a..c13651e 100644 --- a/main.tf +++ b/main.tf @@ -132,7 +132,7 @@ resource "aws_cloudwatch_event_rule" "fsx_health_lambda_schedule" { name = "fsx-health-eventbridge-rule-${random_id.id.hex}" description = "Scheduled execution of the FSx monitor" schedule_expression = var.schedule_expression - is_enabled = true + state = "ENABLED" tags = var.tags } diff --git a/tests/defaults.tftest.hcl b/tests/defaults.tftest.hcl index b0ed52e..af9662a 100644 --- a/tests/defaults.tftest.hcl +++ b/tests/defaults.tftest.hcl @@ -16,14 +16,23 @@ run "eventbridge_default_schedule_expression" { } } +run "eventbridge_default_is_enabled" { + command = plan + + assert { + condition = aws_cloudwatch_event_rule.fsx_health_lambda_schedule.state == "ENABLED" + error_message = "CloudWatch EventBride rule state is not matching state of ENABLED" + } +} + ## # The default value for CloudWatch Alarm property treat_missing_data should be set to breaching. ## run "aws_cloudwatch_metric_alarm_default_treat_missing_data" { command = plan variables { - filesystem_ids = ["fs-01234567890123456"] - enable_cloudwatch_alarms = true + filesystem_ids = ["fs-01234567890123456"] + enable_cloudwatch_alarms = true } assert {