-
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 validations #12817
r/cloudwatch_metric_alarm - add validations #12817
Conversation
Verified acceptance tests: $ 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 120m
=== 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_AlarmActions_EC2Automate
=== CONT TestAccAWSCloudWatchMetricAlarm_disappears
=== CONT TestAccAWSCloudWatchMetricAlarm_tags
=== CONT TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== CONT TestAccAWSCloudWatchMetricAlarm_expression
=== CONT TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== CONT TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== CONT TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== CONT TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== CONT TestAccAWSCloudWatchMetricAlarm_basic
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (11.28s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_disappears (21.22s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (24.66s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (25.74s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (28.96s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (31.30s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (32.19s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (42.42s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (42.51s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (63.80s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (101.23s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (228.22s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 228.265s |
3c4c577
to
960f02d
Compare
Verified acceptance tests: $ 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 120m
go: downloading github.com/aws/aws-sdk-go v1.31.0
go: extracting github.com/aws/aws-sdk-go v1.31.0
go: finding github.com/aws/aws-sdk-go v1.31.0
=== 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_disappears
=== CONT TestAccAWSCloudWatchMetricAlarm_tags
=== CONT TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== CONT TestAccAWSCloudWatchMetricAlarm_expression
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== CONT TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== CONT TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== CONT TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== CONT TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (10.93s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_disappears (21.02s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (23.25s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (24.78s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (27.06s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (29.07s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (30.23s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (40.76s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (40.92s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (60.03s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (96.70s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (213.34s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 213.386s |
bc24a75
to
6cba084
Compare
6cba084
to
fe2feec
Compare
remove `_strArrPtrToList` function and use set functions instead
0578850
to
469c142
Compare
Co-authored-by: Brian Flad <bflad417@gmail.com>
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.
Fixing up a few things before verifying again. 👍
}, | ||
"period": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
ConflictsWith: []string{"metric_query"}, | ||
ValidateFunc: validation.Any( |
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.
This one is valid 👍
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.
Looks good to me, thank you, @DrFaust92 🚀
References:
- https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/#pkg-constants
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html
Output from acceptance testing in AWS Commercial:
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (177.84s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (26.40s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (25.53s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (25.28s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (22.65s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_disappears (19.51s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (33.19s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (67.61s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (22.59s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (11.62s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (47.01s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (33.18s)
Output from acceptance testing in AWS GovCloud (US):
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (199.57s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (23.82s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (23.14s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (22.45s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (19.66s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_disappears (16.42s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (33.05s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (78.23s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (18.22s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (8.10s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (48.94s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (33.07s)
This has been released in version 3.29.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! |
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! |
Community Note
Relates #13624
Relates #13826
Release note for CHANGELOG:
Output from acceptance testing: