Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix deprecation warning in cloudwatch eventbridge rule #56

Merged
merged 2 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.89.0
rev: v1.89.1
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand Down
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
Loading