SumoLogic / terraform-provider-sumologic

Terraform provider for Sumo Logic
https://www.terraform.io/docs/providers/sumologic/
Mozilla Public License 2.0
40 stars 57 forks source link

Example SLO from documentation fails with error #479

Open mccartney opened 1 year ago

mccartney commented 1 year ago

Take the following:

resource "sumologic_slo" "slo_tf_window_based" {
  name        = "slo-tf-window-based"
  description = "example SLO created with terraform"
  parent_id   = "0000000000000001"
  signal_type = "Latency"
  service     = "auth"
  application = "login"
  compliance {
    compliance_type = "Rolling"
    size            = "7d"
    target          = 99
    timezone        = "Asia/Kolkata"
  }
  indicator {
    window_based_evaluation {
      op         = "LessThan"
      query_type = "Metrics"
      size       = "1m"
      threshold  = 200
      queries {
        query_group_type = "Threshold"
        query_group {
          row_id        = "A"
          query         = "metric=request_time_p90  service=auth api=login"
          use_row_count = false
        }
      }
    }
  }
}

straight from the provider documentation. When you apply it, you get:

│ Error: {"id":"F27ZZ-NM2EL-VIGFX","errors":[{"code":"slos:invalid_sli_evaluation_condition","message":"Invalid SLI evaluation condition.","detail":"Threshold based SLIs must have an aggregation defined over the window."}]}
mccartney commented 1 year ago

The doc also says:

aggregation - (Optional) Aggregation function applied over each window to arrive at SLI. Valid values are Avg , Sum, Count, Max, Min and p[1-99].

I guess the "Optional" needs a comment - it seems required in some cases.