-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
issue #4350 change datapointsToAlarm attribute in aws_cloudwatch_metric_alarm #5095
Conversation
I'm not sure we want to disable Terraform's drift detection for the attribute. Someone can modify the alarm outside of Terraform and re-configure it for M out of N (in Terraform terms, a different |
@bflad then its better to ignore this difference. But I think its better to add validation for minimum value as per API doc(https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html). |
We can add the validation, but it would not resolve the linked issue. I'll mark the PR to not close it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @saravanan30erd! 🚀
7 tests passed (all tests)
=== RUN TestAccAWSCloudWatchMetricAlarm_missingStatistic
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (2.79s)
=== RUN TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (6.66s)
=== RUN TestAccAWSCloudWatchMetricAlarm_extendedStatistic
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (6.81s)
=== RUN TestAccAWSCloudWatchMetricAlarm_basic
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (6.96s)
=== RUN TestAccAWSCloudWatchMetricAlarm_importBasic
--- PASS: TestAccAWSCloudWatchMetricAlarm_importBasic (7.29s)
=== RUN TestAccAWSCloudWatchMetricAlarm_treatMissingData
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (11.36s)
=== RUN TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (11.55s)
@bflad is there any possible solution for this issue? |
Theoretically, it can be done via The new acceptance test to cover this behavior will need to create an alarm in its first step (omitting
|
This has been released in version 1.27.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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)
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) https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html (AWS API docs)
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Fixes #4350Changes proposed in this pull request:
Change 1changed datapointsToAlarm to computed attribute.
Set validation for minimum value.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html
Output from acceptance testing: