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

Terraform Plan Bug with Recording Rules #1967

Open
nscherer-chipotle opened this issue Dec 19, 2024 · 0 comments
Open

Terraform Plan Bug with Recording Rules #1967

nscherer-chipotle opened this issue Dec 19, 2024 · 0 comments

Comments

@nscherer-chipotle
Copy link

nscherer-chipotle commented Dec 19, 2024

Terraform Version

1.10.2

Terraform Grafana Provider Version

3.15.3

Grafana Version

Cloud

Affected Resource(s)

grafana_rule_group

Terraform Configuration Files

resource "grafana_rule_group" "recording_rules" {
  name             = "Every 5 Minutes"
  folder_uid       = var.recording_rule_folder_uid
  interval_seconds = 300

  rule {
    name      = "Time:AmericaNewYork:IsNowDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 300
        to   = 0
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the current time is in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:IsNowDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is1wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 605100
        to   = 604800
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 1 week ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is1wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is2wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 1209900
        to   = 1209600
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 2 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is2wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is3wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 1814700
        to   = 1814400
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 3 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is3wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is4wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 2419500
        to   = 2419200
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 4 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is4wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is5wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 3024300
        to   = 3024000
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 5 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is5wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is6wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 3629100
        to   = 3628800
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 6 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is6wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is7wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 4233900
        to   = 4233600
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 7 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is7wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is8wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 4838700
        to   = 4838400
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 8 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is8wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is9wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 5443500
        to   = 5443200
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 9 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is9wAgoDuringDST"
      from   = "A"
    }
  }
  rule {
    name      = "Time:AmericaNewYork:Is10wAgoDuringDST"
    condition = "A"

    data {
      ref_id = "A"

      relative_time_range {
        from = 6048300
        to   = 6048000
      }

      datasource_uid = "grafanacloud-prom"
      model          = "{\"editorMode\":\"code\",\"expr\":\"# This determines if the time 10 weeks ago was in Daylight Saving Time (for the America/New_York timezone)\\n# Returns 1 for true and 0 for false\\n\\n(vector(1) and (month() > 3 and month() < 11)) # True if month is April through October, which are always in DST\\n          or\\n          (vector(1) and (month() == 3 and ((day_of_month() - day_of_week()) - 7) >= 0 and (((day_of_month() - day_of_week()) - 14) > 0 or absent(day_of_week() == 0)))) # True if it is the second Sunday or after in March\\n          or\\n          (vector(1) and (month() == 11 and (day_of_month() - day_of_week()) < 0 and (absent(day_of_week() == 0))))\\n          or # True if it is before the first Sunday in November\\n          (\\n            vector(1)\\n              and\\n            (\\n              (month() == 3 and hour() >= 6 and (((day_of_month() - day_of_week()) - 7) >= 0 and ((day_of_month() - day_of_week()) - 14) <= 0)) # True if it is spring forward day after the time change\\n                  or\\n              (month() == 11 and hour() < 5 and ((day_of_month() - day_of_week()) - 7) < 0) # True if it is fall back day before the time change\\n            )\\n              and\\n            (day_of_week() == 0)\\n          )\\n          or\\n          vector(0) # If none of the other conditions evaluated True, return False\",\"instant\":true,\"intervalMs\":1000,\"legendFormat\":\"__auto\",\"maxDataPoints\":43200,\"range\":false,\"refId\":\"A\"}"
    }

    is_paused = false

    record {
      metric = "Time:AmericaNewYork:Is10wAgoDuringDST"
      from   = "A"
    }
  }
}

Expected Behavior

terraform plan should only show updates for things that have actually changed in the TF config since last time it was run.

Actual Behavior

terraform plan shows changes for every recording rule every time it is run. See below for output:

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.grafana_alertmanager_alerts.grafana_rule_group.recording_rules_cus["applies_to_env"] will be updated in-place
  ~ resource "grafana_rule_group" "recording_rules_cus" {
        id                 = "1:ee5xed645t4aod:Every 5 Minutes (CUS Only)"
        name               = "Every 5 Minutes (CUS Only)"
        # (4 unchanged attributes hidden)

      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:IsNowDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is1wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is2wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is3wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is4wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is5wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is6wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is7wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is8wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is9wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
      ~ rule {
          + condition      = "A"
          + exec_err_state = "Alerting"
            name           = "Time:AmericaNewYork:Is10wAgoDuringDST"
          + no_data_state  = "NoData"
            # (5 unchanged attributes hidden)

            # (2 unchanged blocks hidden)
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. Plan and apply any recording rule.
  2. Run plan again with no changes to config.

Important Factoids

exec_error_state and no_data_state are not set in the TF config, and I don't believe they are even relevant for recording rules.

condition is set in the TF config, but that is only because the provider requires it to be set for every rule, and I feel like perhaps it shouldn't be required for recording rules? It's not included when you export a recording rule as HCL from Grafana itself.

References

No response

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