-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.needs-triageWaiting for first response or review from a maintainer.Waiting for first response or review from a maintainer.service/cloudwatchIssues and PRs that pertain to the cloudwatch service.Issues and PRs that pertain to the cloudwatch service.
Description
Terraform and AWS Provider Version
Terraform v1.9.8
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v6.24.0
Your version of Terraform is out of date! The latest version
is 1.14.1. You can update by downloading from https://www.terraform.io/downloads.htmlAffected Resource(s) or Data Source(s)
cloudwatch_metric_alarm
Expected Behavior
You should be able to specify:
datapoints_to_alarm = 0
In order to get the default behavior of datapoints_to_alarm being the same as evaluation_periods. If you don't set a value for datapoints_to_alarm initially and then set one to some positive integer, terraform will report the change like:
# aws_cloudwatch_metric_alarm.example will be updated in-place
~ resource "aws_cloudwatch_metric_alarm" "example" {
~ datapoints_to_alarm = 0 -> 1
Indicating that it did use 0 for the default value. And looking at the alarm in the AWS console, under "Conditions" -> "Datapoints to alarm", it says "N out of N" where N is whatever you have evaluation_periods set to.
Actual Behavior
You get the error Error: expected datapoints_to_alarm to be at least (1), got 0
Relevant Error/Panic Output
Sample Terraform Configuration
Click to expand configuration
resource "aws_cloudwatch_metric_alarm" "example" {
datapoints_to_alarm = 0
}Steps to Reproduce
- Specify a
cloudwatch_metric_alarmresource withdatapoints_to_alarm = 0 - Run
terraform planorterraform apply
Debug Logging
No response
GenAI / LLM Assisted Development
n/a
Important Facts and References
No response
Would you like to implement a fix?
No
Metadata
Metadata
Assignees
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.needs-triageWaiting for first response or review from a maintainer.Waiting for first response or review from a maintainer.service/cloudwatchIssues and PRs that pertain to the cloudwatch service.Issues and PRs that pertain to the cloudwatch service.