Skip to content
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

AWS CloudWatch Alarm - Anomaly detection #9828

Merged
merged 4 commits into from
Nov 21, 2019
Merged

AWS CloudWatch Alarm - Anomaly detection #9828

merged 4 commits into from
Nov 21, 2019

Conversation

hakopako
Copy link
Contributor

@hakopako hakopako commented Aug 20, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #9293

Release note for CHANGELOG:

ENHANCEMENTS: resource/aws_cloudwatch_metric_alarm: Add support for ThresholdMetricId field used in Anomaly Detection Alarm [GH-9293]

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSCloudWatchMetricAlarm_expression'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSCloudWatchMetricAlarm_expression -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSCloudWatchMetricAlarm_expression
=== PAUSE TestAccAWSCloudWatchMetricAlarm_expression
=== CONT  TestAccAWSCloudWatchMetricAlarm_expression
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (119.49s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       119.539s
...

@hakopako hakopako requested a review from a team August 20, 2019 14:23
@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Aug 20, 2019
@hakopako hakopako changed the title [WIP] AWS CloudWatch Alarm - Anomaly detection AWS CloudWatch Alarm - Anomaly detection Aug 21, 2019
@speedmann
Copy link

Is there anything to assist with to get this merged?
I tested the module and it works as expected. I can create/remove/update anomaly detection alerts.

Is there anything missing for this to be merged?

@hakopako
Copy link
Contributor Author

hakopako commented Sep 8, 2019

I assume waiting for General Availability announcement. 😃

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html

CloudWatch anomaly detection is in open preview. The preview is open to AWS accounts in all commercial AWS Regions. You do not need to request access. Features may be added or changed before announcing General Availability.

@aeschright aeschright added the enhancement Requests to existing resources that expand the functionality or scope. label Sep 11, 2019
@cirnatdan
Copy link

On August 29, 2019, we added support for using AWS CloudFormation to deploy alarms based on anomaly detection models.For more information, see AWS::CloudWatch::Alarm.

Given that Anomaly Detection alarms can be provisioned with CloudFormation, wouldn't it be great to have them supported by the terraform plugin as well?

@unacceptable
Copy link
Contributor

Not that my approval means much. 🙂

@unacceptable
Copy link
Contributor

unacceptable commented Oct 15, 2019

@bflad I see you approved some PR's last week for the v2.33.0 milestone (https://github.com/terraform-providers/terraform-provider-aws/milestone/105).

Could we see about getting this PR and accompanying issue added to an upcoming milestone (like v2.34.0)?

@unacceptable
Copy link
Contributor

unacceptable commented Oct 18, 2019

This is now "generally available" (as of yesterday) if that is what some reviewers are waiting for:

https://aws.amazon.com/about-aws/whats-new/2019/10/amazon-cloudwatch-anomaly-detection-now-generally-available/

@unacceptable
Copy link
Contributor

@bflad @apparentlymart - Can this make it into an upcoming milestone now that this CloudWatch Anomaly Detection is now generally available?

@unacceptable
Copy link
Contributor

@hakopako Can you add the people that I mentioned as reviewers to this PR?

@hakopako
Copy link
Contributor Author

Seems I don't have the permission for assignment 😅
@bflad @apparentlymart Could you have a look at this PR, please?

@aeschright
Copy link
Contributor

Hi folks, the AWS provider team is already assigned to review this PR so you don't need to do anything further. We're still working through the backlog but you'll see an update as soon as we have one. Thanks so much!

@unacceptable
Copy link
Contributor

This should also resolve #10551.

@unacceptable
Copy link
Contributor

@aerostitch any chance of this getting reviewed soon? This has been the 8th most reacted to PR for some time now:

https://github.com/terraform-providers/terraform-provider-aws/pulls?q=is%3Apr+is%3Aopen+sort%3Areactions-%2B1-desc

I am only curious because I have a story that has been following me around for a few sprints now. I am about to give up and just do the work in CloudFormation. 😕

What would it take to get this added to a milestone?

@aerostitch
Copy link
Contributor

Not sure why you pinged me here @unacceptable. Maybe you meant to ping @aeschright ?

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hakopako 👋 Thank you for submitting this. The existing resource testing found a regression that will need to get fixed, but otherwise this is in pretty good shape. Please reach out if you have any questions or do not have time to implement the feedback.

aws/resource_aws_cloudwatch_metric_alarm.go Outdated Show resolved Hide resolved
aws/resource_aws_cloudwatch_metric_alarm.go Show resolved Hide resolved
aws/resource_aws_cloudwatch_metric_alarm.go Outdated Show resolved Hide resolved
@bflad bflad self-assigned this Nov 15, 2019
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Nov 15, 2019
@hakopako
Copy link
Contributor Author

Thank you for reviewing :)
Fixed some code and here is the test output:

>>> [terraform-provider-aws] $ make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchMetricAlarm'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -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
=== CONT  TestAccAWSCloudWatchMetricAlarm_basic
=== CONT  TestAccAWSCloudWatchMetricAlarm_tags
=== CONT  TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm
=== CONT  TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction
=== CONT  TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic
=== CONT  TestAccAWSCloudWatchMetricAlarm_treatMissingData
=== CONT  TestAccAWSCloudWatchMetricAlarm_missingStatistic
=== CONT  TestAccAWSCloudWatchMetricAlarm_expression
=== CONT  TestAccAWSCloudWatchMetricAlarm_extendedStatistic
=== CONT  TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate
=== CONT  TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (11.19s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (31.49s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (33.34s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (38.77s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (44.05s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (44.24s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (53.97s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (54.51s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (82.70s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (134.12s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (358.33s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       358.416s

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 21, 2019
@hakopako hakopako requested a review from bflad November 21, 2019 15:53
@bflad bflad added this to the v2.40.0 milestone Nov 21, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, @hakopako! Looks good to me. 🚀

Output from acceptance testing:

--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (5.17s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (10.90s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (10.85s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (11.01s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (11.29s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (13.02s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (15.78s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (15.90s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (21.51s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (33.68s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (177.58s)

@bflad bflad merged commit 5caa5ba into hashicorp:master Nov 21, 2019
bflad added a commit that referenced this pull request Nov 21, 2019
pixelpogo pushed a commit to babbel/terraform-provider-aws that referenced this pull request Nov 22, 2019
…t Anomaly Detection Metrics) (hashicorp#9828)

Output from acceptance testing:

```
--- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (5.17s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_basic (10.90s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (10.85s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (11.01s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (11.29s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (13.02s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (15.78s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (15.90s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_tags (21.51s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_expression (33.68s)
--- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (177.58s)
```
pixelpogo pushed a commit to babbel/terraform-provider-aws that referenced this pull request Nov 22, 2019
@ghost
Copy link

ghost commented Nov 27, 2019

This has been released in version 2.40.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!

@ghost
Copy link

ghost commented Mar 29, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS CloudWatch Metric Alarm (aws_cloudwatch_metric_alarm) - Anomaly detection
7 participants