Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
Ensure valid datapoints_to_alarm value
Browse files Browse the repository at this point in the history
We're seeing AWS reject requests for this:
```
datapoints_to_alarm:      "0"
```

It turns out it must be >= 1, and when omitted, CloudWatch Alarms does the right thing, but Terraform wants to default this to "0" still:

hashicorp/terraform-provider-aws#4350 (problem report)
hashicorp/terraform-provider-aws#5095 (validation to 1)
  • Loading branch information
martinb3 committed Aug 27, 2018
1 parent 4d89809 commit 93fc297
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ resource "aws_cloudwatch_metric_alarm" "status_check_failed_instance_alarm_reboo
period = "${var.failed_instance_checks_period}"
statistic = "Minimum"
threshold = "0"
datapoints_to_alarm = "1"
unit = "Count"

dimensions {
Expand All @@ -77,6 +78,7 @@ resource "aws_cloudwatch_metric_alarm" "status_check_failed_instance_alarm_ticke
period = "${var.failed_instance_checks_period}"
statistic = "Minimum"
threshold = "0"
datapoints_to_alarm = "1"
unit = "Count"

dimensions {
Expand Down

0 comments on commit 93fc297

Please sign in to comment.