terraform-provider-newrelic icon indicating copy to clipboard operation
terraform-provider-newrelic copied to clipboard

AzureAppServicePlan Not Supported by Infra Alert Condition

Open ironf1st opened this issue 2 years ago • 1 comments

Please include the following with your bug report

:warning: Important: Failure to include the following, such as omitting the Terraform configuration in question, may delay resolving the issue.

  • [x] Your New Relic provider configuration (sensitive details redacted)
  • [x] A list of affected resources and/or data sources
  • [x] The configuration of the resources and/or data sources related to the bug report (i.e. from the list mentioned above)
  • [x] Description of the current behavior (the bug)
  • [x] Description of the expected behavior
  • [x] Any related log output

Terraform Version

Terraform v1.1.9 on darwin_amd64 provider registry.terraform.io/newrelic/newrelic v2.43.4

Affected Resource(s)

  • newrelic_infra_alert_condition

Terraform Configuration


resource "newrelic_alert_policy" "test" {
  name                = "My Test App"
  incident_preference = "PER_CONDITION"
}

resource "newrelic_infra_alert_condition" "test" {
  policy_id = newrelic_alert_policy.test.id

  comparison            = "above"
  enabled               = true
  integration_provider  = "AzureAppServicePlan"
  name                  = "Average CPU Use High"
  select                = "cpuPercent.Average"
  type                  = "infra_metric"
  violation_close_timer = 24
  where                 = "name LIKE '%plan-test-1234%'"

  critical {
    duration      = 5
    value         = 95
    time_function = "all"
  }

  warning {
    duration      = 5
    value         = 85
    time_function = "all"
  }
}

Actual Behavior

On apply I get the following error: Error: 400 response returned: applying integrations: failed to lookup integration AzureAppServicePlan

The same error occurs if I set the integration_provider to AzureAppServicePlanSample

I can create this alert in the UI, via newrelic_nrql_alert_condition and it is one of the listed event types in the Integration's documentation

Expected Behavior

The apply should succeed and my alert condition should be created.

ironf1st avatar Apr 28 '22 15:04 ironf1st

Thank you reporting @ironf1st, we will check and resolve the issue.

sandeepkumar-kagitha avatar Apr 29 '22 19:04 sandeepkumar-kagitha

Hi @ironf1st

I wouldn't build on newrelic_infra_alert_condition as it will go away long term, and we're not doing any additional development work on this resource. The workaround would be to use NRQL, but it seems like you're already doing that? If you need any help building the query please let us know.

kidk avatar Nov 23 '22 10:11 kidk