File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
modules/cloudwatch_metrics Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ resource "aws_iam_role_policy_attachment" "this" {
39
39
resource "aws_cloudwatch_event_rule" "trigger" {
40
40
name_prefix = var. eventbridge_name_prefix
41
41
description = " Periodically trigger Observe Lambda to collect CloudWatch metrics"
42
- schedule_expression = " cron( ${ var . interval / 60 } * * * ? * )"
42
+ schedule_expression = var . interval == 60 ? " rate(1 minute) " : " rate( ${ var . interval / 60 } minutes )"
43
43
event_bus_name = var. eventbridge_schedule_event_bus_name
44
44
}
45
45
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ variable "interval" {
35
35
nullable = false
36
36
default = 300
37
37
validation {
38
- condition = var. interval >= 60 && var. interval < 3600
39
- error_message = " interval must be greater than or equal to 60 and less than 3600. "
38
+ condition = var. interval >= 60 && var. interval <= 10800
39
+ error_message = " interval must be in [60, 10800] (1 minute to 3 hours) "
40
40
}
41
41
}
42
42
You can’t perform that action at this time.
0 commit comments