Skip to content
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 modules/cloudwatch_metrics/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "aws_iam_role_policy_attachment" "this" {
resource "aws_cloudwatch_event_rule" "trigger" {
name_prefix = var.eventbridge_name_prefix
description = "Periodically trigger Observe Lambda to collect CloudWatch metrics"
schedule_expression = "cron(${var.interval / 60} * * * ? *)"
schedule_expression = var.interval == 60 ? "rate(1 minute)" : "rate(${var.interval / 60} minutes)"
event_bus_name = var.eventbridge_schedule_event_bus_name
}

Expand Down
4 changes: 2 additions & 2 deletions modules/cloudwatch_metrics/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ variable "interval" {
nullable = false
default = 300
validation {
condition = var.interval >= 60 && var.interval < 3600
error_message = "interval must be greater than or equal to 60 and less than 3600."
condition = var.interval >= 60 && var.interval <= 10800
error_message = "interval must be in [60, 10800] (1 minute to 3 hours)"
}
}

Expand Down