From 883b011f7f4eeaf18bba19df1ede5ffc08335ac1 Mon Sep 17 00:00:00 2001 From: Stefan Freitag Date: Sat, 27 Apr 2024 19:24:57 +0200 Subject: [PATCH] feat: replace deprecated is_enabled --- README.md | 4 ++-- examples/01_default_configuration/versions.tf | 4 ++-- main.tf | 2 +- tests/defaults.tftest.hcl | 9 +++++++++ versions.tf | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4b6dfe0..399fda4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This module deploys a Lambda function that checks the health of MSK cluster and |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | | [archive](#requirement\_archive) | >=2.4.0 | -| [aws](#requirement\_aws) | >= 5.0 | +| [aws](#requirement\_aws) | >= 5.32 | | [random](#requirement\_random) | >=3.5.1 | ## Providers @@ -20,7 +20,7 @@ This module deploys a Lambda function that checks the health of MSK cluster and | Name | Version | |------|---------| | [archive](#provider\_archive) | >=2.4.0 | -| [aws](#provider\_aws) | >= 5.0 | +| [aws](#provider\_aws) | >= 5.32 | ## Modules diff --git a/examples/01_default_configuration/versions.tf b/examples/01_default_configuration/versions.tf index 618c4f4..f91af38 100644 --- a/examples/01_default_configuration/versions.tf +++ b/examples/01_default_configuration/versions.tf @@ -1,9 +1,9 @@ terraform { - required_version = "~>1.5" + required_version = "~>1.8" required_providers { aws = { source = "hashicorp/aws" - version = "~>5.0" + version = "~>5.32" } } } diff --git a/main.tf b/main.tf index 9fdcbfe..c2c7687 100644 --- a/main.tf +++ b/main.tf @@ -140,7 +140,7 @@ resource "aws_cloudwatch_event_rule" "this" { name = var.name description = "Scheduled execution of the MSK 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 cbca13c..4d21f6c 100644 --- a/tests/defaults.tftest.hcl +++ b/tests/defaults.tftest.hcl @@ -10,6 +10,15 @@ run "eventbridge_default_schedule_expression" { } } +run "eventbridge_default_is_enabled" { + command = plan + + assert { + condition = aws_cloudwatch_event_rule.this.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. ## diff --git a/versions.tf b/versions.tf index 73bdec1..44cfd01 100644 --- a/versions.tf +++ b/versions.tf @@ -8,7 +8,7 @@ terraform { } aws = { source = "hashicorp/aws" - version = ">= 5.0" + version = ">= 5.32" } random = { source = "hashicorp/random"