dollarshaveclub / terraform-provider-nrs

A Terraform provider for New Relic Synthetics
MIT License
22 stars 4 forks source link

Failure to Create Alert Conditions Properly #4

Open asms opened 7 years ago

asms commented 7 years ago

Terraform has successfully created alert conditions for synthetic monitors, at least initially. However, I have experienced two interrelated issues:

  1. Terraform has created multiple identical alert conditions.
  2. I am now receiving 500 Internal Server Errors during terraform apply in regard to creating alert conditions.

I contacted NewRelic about this and they had this to say about the 500 HTTP status codes:

In regards to the 400 and 500 errors, I had a look at our code base and it looks like a 400 error is returned and then kicks off something else which causes a 500 error. I agree that this is misleading so I'm going to file an improvement request.

Sample partial terraform apply output:


Error applying plan:

109 error(s) occurred:

* nrs_alert_condition.bento-app1f-api-v2-accounts-crudi: 1 error(s) occurred:

* nrs_alert_condition.bento-app1f-api-v2-accounts-crudi: error: could not create alert condition: error: invalid response from CreateAlertCondition with code 500. Message: {"error":{"title":"Internal Server Error"}}
* nrs_alert_condition.bento-app1b-api-v2-sequence-states-crdi: 1 error(s) occurred:

...
dankozlowski commented 7 years ago

I'm helping @asms on this project, and it turns out that New Relic won't allow more than 200 alert conditions on an alert policy. They should likely be returning a 422 or something more useful instead of a 500, but their support team has confirmed that's the issue.

This issue can be closed.