opentelekomcloud / terraform-provider-opentelekomcloud

Terraform OpenTelekomCloud provider
https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest
Mozilla Public License 2.0
87 stars 78 forks source link

opentelekomcloud_ces_alarmrule : cannot use multiple dimensions #2392

Open reiSh6phoo9o opened 10 months ago

reiSh6phoo9o commented 10 months ago

Hi,

I'm trying to create an alarmrule with multiple dimensions. As I understand from the docs ( https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest/docs/resources/ces_alarmrule#dimensions ), this should be possible, though the docs here are not clear to me ("list of metric dimensions" is vague and rather unclear. I guess: multiple blocks).

I can create multiple dimensions using the webgui, but not using terraform.

Specifically, I want to create one alarmrule, which monitors both nodes of a HA RDS setup.

Terraform provider version

Terraform v1.5.7 on darwin_amd64

Affected Resource(s)

Terraform Configuration Files

resource "opentelekomcloud_ces_alarmrule" "high_cpu_usage" {
  alarm_name    = "test"
  alarm_level   = 2
  metric {
    namespace   = "SYS.RDS"
    metric_name = "rds001_cpu_util"
    dimensions {
      name  = "rds_instance_id"
      value = opentelekomcloud_rds_instance_v3.main.nodes[0].id
    }
    dimensions {
      name  = "rds_instance_id"
      value = opentelekomcloud_rds_instance_v3.main.nodes[1].id
    }
  }
  condition { ... }
    period              = 300
    filter                 = "max"
    comparison_operator = ">"
    value                = 80
    unit                  = "%"
    count               = 5
  }
  alarm_actions {
    type              = "notification"
    notification_list = [opentelekomcloud_smn_topic_v2.alerts.id]
  }
  ok_actions {
    type              = "notification"
    notification_list = [opentelekomcloud_smn_topic_v2.alerts.id]
  }
}

Steps to Reproduce

  1. terraform apply

Expected Behavior

The alarmrule should be created, and it should monitor two objects (node0 and node2).

Actual Behavior

An alarmrule is created, but it does not trigger an alert. If I compare it to the alertrule I click in the GUI, the diff is:

References

from this ticket, I expected that the syntax is use should work:

anton-sidelnikov commented 10 months ago

Hi @reiSh6phoo9o same behaviour if you create alarm rule by api through curl, i will create internal ticket, not terraform issue

anton-sidelnikov commented 10 months ago

Created internal issue: https://jira.tsi-dev.otc-service.com/browse/BM-3840

deem1978 commented 4 months ago

Hello @anton-sidelnikov, is there any news related to this topic?

anton-sidelnikov commented 4 months ago

Hi @deem1978, sorry but still in progress. Seems the backend team will publish newer version of api v2.0, which will give us ability to use multiple dimensions.