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

[bug] newrelic_nrql_alert_condition aggregation delay value reset to default #2455

Open
walid-farhani opened this issue Sep 4, 2023 · 0 comments

Comments

@walid-farhani
Copy link

Terraform Version

Terraform v1.5.5
on darwin_arm64

Affected Resource(s)

newrelic_nrql_alert_condition

Terraform Configuration

terraform {
  required_providers {
    newrelic = {
      source  = "newrelic/newrelic"
      version = "3.22.0"
    }
  }
}


provider "newrelic" {
  api_key    = "xxx"
  account_id = "xxx"
  region     = "xxxx"
}

resource "newrelic_alert_policy" "alert_policy" {
  name                = "MY_TEST_POLICY_VCS"
  incident_preference = "PER_CONDITION"
}


resource "newrelic_nrql_alert_condition" "nrql_condition" {
  policy_id          = newrelic_alert_policy.alert_policy.id
  name               = "mynrqlalert"
  type               = "static"
  aggregation_window = 30
  aggregation_method = "event_flow"
  aggregation_delay  = 0

  nrql {
    query = "SELECT count(*) FROM Log WHERE `message` = 'TERM:'"
  }
  critical {
    operator              = "above_or_equals"
    threshold             = 2
    threshold_duration    = 300
    threshold_occurrences = "AT_LEAST_ONCE"
  }
}

Actual Behavior

The aggregation delay was set before to 120, and when I changed it to 0 nothing was changed in terraform when running terraform plan & apply

Expected Behavior

The value of the aggregation delay params needs to be changed to 0 from 120, the weird behavior that I was able to detect is that the value of the aggregation delay is updated for whatever value other than 0 when the current value is 120, for example, if I change it to 300 from 120 it will be updated to 5 minutes in the state file and in the UI, then once it is 300 I can update it to 0 and it will be reflected in the state file, the only blocker here is when the value is 120 it cannot be updated to 0.

Steps to Reproduce

  1. terraform apply
@walid-farhani walid-farhani changed the title newrelic_nrql_alert_condition aggregation delay value reset to default [bug] newrelic_nrql_alert_condition aggregation delay value reset to default Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant