mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
241 stars 167 forks source link

Can't create SYSTEM_NORMALIZED_CPU_IOWAIT alert #172

Closed cupuyc closed 4 years ago

cupuyc commented 4 years ago

An invalid enumeration value SYSTEM_NORMALIZED_CPU_IOWAIT was specified.

mongodbatlas_alert_configuration.cpu_io_wait: Creating...

Error: error creating Alert Configuration information: POST https://cloud.mongodb.com/api/atlas/v1.0/groups/5e384f0dcf09a208528fb22d/alertConfigs: 400 (request "Bad Request") An invalid enumeration value SYSTEM_NORMALIZED_CPU_IOWAIT was specified.

  on main.tf line 229, in resource "mongodbatlas_alert_configuration" "cpu_io_wait":
 229: resource "mongodbatlas_alert_configuration" "cpu_io_wait" {

My resource definition:

terraform {
  required_version = ">= 0.12.14"
}

provider "mongodbatlas" {
  version = "~> 0.4.2"
}
resource "mongodbatlas_alert_configuration" "cpu_io_wait" {
  project_id = data.mongodbatlas_project.project_dev.id
  event_type = "OUTSIDE_METRIC_THRESHOLD"
  enabled    = true

  notification {
    type_name     = "GROUP"
    interval_min  = 60
    delay_min     = 3
    sms_enabled   = false
    email_enabled = true
  }

  notification {
    type_name     = "SLACK"
    interval_min  = 60
    delay_min     = 3
    channel_name  = "alerts-atlas"
    api_token     = var.slack_token
  }

  metric_threshold = {
    metric_name    = "SYSTEM_NORMALIZED_CPU_IOWAIT"
    units          = "RAW"
    operator       = "GREATER_THAN"
    threshold      = 60
    mode           = "AVERAGE"
  }
}
themantissa commented 4 years ago

@cupuyc I had our docs team update the available metrics recently as it was out of date. That one is not included and I assume not valid (I confirmed with a test): https://docs.atlas.mongodb.com/reference/api/process-measurements/#measurement-types The provider supports what is available via the API so if you desire a specific metric that is not available feel free to request via feedback.mongodb.com or file a support ticket for guidance on your alerting use case.

cupuyc commented 4 years ago

We ended up using GUI for now.