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
240 stars 168 forks source link

mongodbatlas_alert_configuration - not able to generate any alerts with event_type = "OUTSIDE_METRIC_THRESHOLD" and matcher.fieldName != "TYPE_NAME" #164

Closed AntjeRadkiewicz1337 closed 4 years ago

AntjeRadkiewicz1337 commented 4 years ago

Hi,

our mongodbatlas_alert_configuration should create an alert with matchers for a specific hostname and event_type = OUTSIDE_METRIC_THRESHOLD. When I do a terraform plan I get following error:

Error: expected matcher.0.value to be one of [PRIMARY SECONDARY STANDALONE CONFIG MONGOS], got <NAME_OF_OUR_CLUSTER>

In the documentation from mongoDB it is writen: If "matchers.fieldName" : "TYPE_NAME", you can match on the following values:

We are not using the matcher.fieldname = "TYPE_NAME"

This is the mongo_alert we are trying to generate:

resource "mongodbatlas_alert_configuration" "disk_io_utlization" {
  project_id      = <PROJECT-ID>
  event_type      = "OUTSIDE_METRIC_THRESHOLD"
  enabled         = true

  matcher {
    field_name = "CLUSTER_NAME"
    operator   = "EQUALS"
    value      = <NAME_OF_OUR_CLUSTER>
  }

  metric_threshold = {
    metric_name = "DISK_PARTITION_UTILIZATION_DATA"
    operator    = "GREATER_THAN"
    threshold   = 80
    units       = "RAW"
    mode        = "AVERAGE"
  }

  notification {
    type_name     = "EMAIL"
    interval_min  = 60
    delay_min     = 15
    sms_enabled   = false
    email_address = <EMAIL-ADDRESS>
  }
}

We would like to configure all different kind of alerts. :heart:

PacoDw commented 4 years ago

Hello @AntjeRadkiewicz1337, thank you so much for your review, I resolved it on the fix-#164 branch if you want to test it.

Let us know if you have another comment or concern :)

AntjeRadkiewicz1337 commented 4 years ago

Hei @PacoDw ,

sorry for the late reply. Everything looks fine and we wait for release :)

themantissa commented 4 years ago

@AntjeRadkiewicz1337 the release is out, please try with 0.4.2. Thanks!