terraform-provider-tencentcloud icon indicating copy to clipboard operation
terraform-provider-tencentcloud copied to clipboard

Monitor module doesn't create alarm rules successfully.

Open jianzhiteh opened this issue 4 years ago • 2 comments

We are trying to create alarm rules using the following resources, but when the Terraform shows success messages, the console page https://console.cloud.tencent.com/monitor/alarm2/policy doesn't display the relevant created alarm policies.

Please assist to identify the issue.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • Terraform v0.13.3
  • terraform-provider-tencentcloud_v1.52.0

Affected Resource(s)

  • tencentcloud_monitor_binding_object
  • tencentcloud_monitor_binding_receiver
  • tencentcloud_monitor_policy_group

Terraform Configuration Files

resource "tencentcloud_monitor_binding_receiver" "cdn_monitor_receiver_group" {
  group_id = tencentcloud_monitor_policy_group.cdn_monitor_policy_request_count.id
  receivers {
    start_time         = 0
    end_time           = 86399
    notify_way         = ["SMS"]
    receiver_type      = "user"
    receiver_user_list = [actual_CAM_id]
    receive_language   = "en-US"
  }
}

resource "tencentcloud_monitor_policy_group" "cdn_monitor_policy_request_count" {
  group_name       = "test"
  policy_view_name = "cdn_domain"
  remark           = "CDN Request Count Metric"
  conditions {
    metric_id           = 37
    alarm_notify_type   = 1
    alarm_notify_period = 300
    calc_type           = 1
    calc_value          = 3000
    calc_period         = 300
    continue_period     = 5
  }
}

resource "tencentcloud_monitor_binding_object" "binding" {
  group_id = tencentcloud_monitor_policy_group.cdn_monitor_policy_request_count.id
  dimensions {
    dimensions_json = "{\"domain\":\"x.our_cdn_domain.com\"}"
  }
}

Expected Behavior

Alarm policies should be displayed on console page.

Actual Behavior

No alarm policy is seen created.

Steps to Reproduce

  1. terraform apply
  • #0000

jianzhiteh avatar Jan 18 '21 03:01 jianzhiteh

the same question.

Hook82 avatar Mar 22 '21 08:03 Hook82

tencentcloud_monitor_policy_group has been deprecated and replaced by tencentcloud_monitor_alarm_policy https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/latest/docs/resources/monitor_policy_group

hellertang avatar Dec 20 '21 15:12 hellertang