-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
r/cloudwatch_metric_alarm - add validation to metric_query.metric.stat
+ refactor to use expanded/flatteners
#19571
Conversation
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.
LGTM 🚀.
Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchMetricAlarm_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudWatchMetricAlarm_ -timeout 180m
=== RUN TestAccAWSCloudWatchMetricAlarm_basic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_basic
=== RUN TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
=== PAUSE TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
=== RUN TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== RUN TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== PAUSE TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== RUN TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== PAUSE TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== RUN TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== PAUSE TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== RUN TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== PAUSE TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== RUN TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== RUN TestAccAWSCloudWatchMetricAlarm_expression
=== PAUSE TestAccAWSCloudWatchMetricAlarm_expression
=== RUN TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== RUN TestAccAWSCloudWatchMetricAlarm_tags
=== PAUSE TestAccAWSCloudWatchMetricAlarm_tags
=== RUN TestAccAWSCloudWatchMetricAlarm_disappears
=== PAUSE TestAccAWSCloudWatchMetricAlarm_disappears
=== CONT TestAccAWSCloudWatchMetricAlarm_basic
=== CONT TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== CONT TestAccAWSCloudWatchMetricAlarm_tags
=== CONT TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
=== CONT TestAccAWSCloudWatchMetricAlarm_disappears
=== CONT TestAccAWSCloudWatchMetricAlarm_expression
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== CONT TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== CONT TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== CONT TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (9.20s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_disappears (23.70s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (28.56s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (28.82s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (31.28s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (31.98s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (33.16s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (43.91s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (44.20s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (56.51s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (80.18s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (174.71s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 178.265s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchMetricAlarm_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudWatchMetricAlarm_ -timeout 180m
=== RUN TestAccAWSCloudWatchMetricAlarm_basic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_basic
=== RUN TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
=== PAUSE TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
=== RUN TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== RUN TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== PAUSE TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== RUN TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== PAUSE TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== RUN TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== PAUSE TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== RUN TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== PAUSE TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== RUN TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== RUN TestAccAWSCloudWatchMetricAlarm_expression
=== PAUSE TestAccAWSCloudWatchMetricAlarm_expression
=== RUN TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== PAUSE TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== RUN TestAccAWSCloudWatchMetricAlarm_tags
=== PAUSE TestAccAWSCloudWatchMetricAlarm_tags
=== RUN TestAccAWSCloudWatchMetricAlarm_disappears
=== PAUSE TestAccAWSCloudWatchMetricAlarm_disappears
=== CONT TestAccAWSCloudWatchMetricAlarm_basic
=== CONT TestAccAWSCloudWatchMetricAlarm_expression
=== CONT TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== CONT TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== CONT TestAccAWSCloudWatchMetricAlarm_disappears
=== CONT TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== CONT TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== CONT TestAccAWSCloudWatchMetricAlarm_tags
=== CONT TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (13.38s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_disappears (28.86s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (31.31s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (33.68s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (33.92s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (37.23s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (37.45s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (46.18s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (48.27s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (64.96s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (93.19s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (234.36s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 241.381s
This has been released in version 3.44.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
Hi Guys, While this change has introduced a fix to ensure that the statistic is validated, this has made it stop accepting 'percentile' extended statistics (eg. p95) from being used as part of a metric query stat. According to the AWS documentation, the metric stat can contain either a statistic or an extended statistic:
The error we're seeing:
Should the ValidateFunc be the snippet below?
Regards, Neto |
@aristotelesneto I'm also experiencing this; I've created a new issue (#19665) in case it doesn't get the necessary visibility here on the PR. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
OR Closes #19567
Output from acceptance testing: