Skip to content

Commit

Permalink
feat: replace deprecated is_enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanfreitagrwe authored and stefanfreitag committed Apr 27, 2024
1 parent 60821bd commit 3e6f42f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
13 changes: 11 additions & 2 deletions tests/defaults.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3e6f42f

Please sign in to comment.