coralogix / terraform-provider-coralogix

Terraform provider for Coralogix
https://registry.terraform.io/providers/coralogix/coralogix
Apache License 2.0
9 stars 6 forks source link

Mandatory block in coralogix_alert resource is not documented properly #231

Open rudolf-repcin opened 2 months ago

rudolf-repcin commented 2 months ago

Affected Resource(s)

Terraform Configuration Files

resource "coralogix_alert" "count_get_response_times_warning" {
  name     = "${local.alert_display_name} [Number of GET with response times P90 >= 500ms]"
  enabled  = var.enable_alerts
  severity = "Warning"

  meta_labels = {
    application = var.aws_account_name
    subsystem   = var.ecs_service_name
  }

  standard {
    search_query = ".......omitted..... AND http_request.duration_ms: [500 TO *} ${local.get_http_method_condition_q1}"
    applications = [var.aws_account_name]
    subsystems   = [var.ecs_service_name]
    severities   = [
      "Info", "Error"
    ]
    condition {
      more_than   = true
      threshold   = var.cx_get_slow_request_threshold
      time_window = var.cx_get_slow_request_time_window
    }
  }
}

Debug Output

Error: internal error in Coralogix backend.
│ error - rpc error: code = Internal desc = statusCode: 400, response: {"success":false,"status":400,"message":"alert definition, notificationGroups is invalid , SequelizeValidationError: Must have at least 1 notificationGroups item"}
│ url - com.coralogix.alerts.v2.AlertService/CreateAlert

Expected Behavior

notification_group should be either documented as required or allowed to be optional in CX backend

Actual Behavior

notification_group must be specified otherwise TF plan fails

Important Factoids

Coralogix TF provider v1.14.1 TF v1.8.2

Community Note

celaus commented 1 month ago

Hi! Thanks for reporting this, we are currently working on updating the alerts API which should also take care of this issue. Until then please be patient and use some kind of notification group for all requests 😓

I'll leave this issue open in case someone from the future encounters this error.