alicloud_cms_alarm

This resource provides a alarm rule resource and it can be used to monitor several cloud services according different metrics. Details for alarm rule.

Example Usage

Basic Usage

resource "alicloud_cms_alarm" "basic" {
  name = "tf-testAccCmsAlarm_basic"
  project = "acs_ecs_dashboard"
  metric = "disk_writebytes"
  dimensions = {
    instanceId = "i-bp1247,i-bp11gd"
    device = "/dev/vda1,/dev/vdb1"
  }
  statistics ="Average"
  period = 900
  operator = "<="
  threshold = 35
  triggered_count = 2
  contact_groups = ["test-group"]
  end_time = 20
  start_time = 6
  notify_type = 1
}

Argument Reference

The following arguments are supported:

  • name - (Required) The alarm rule name.
  • project - (Required, ForceNew) Monitor project name, such as "acs_ecs_dashboard" and "acs_rds_dashboard". For more information, see Metrics Reference.
  • metric - (Required, ForceNew) Name of the monitoring metrics corresponding to a project, such as "CPUUtilization" and "networkin_rate". For more information, see Metrics Reference.
  • dimensions - (Required, ForceNew) Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string and it uses comma to split multiple items. For more information, see Metrics Reference.
  • period - Index query cycle, which must be consistent with that defined for metrics. Default to 300, in seconds.
  • statistics - Statistical method. It must be consistent with that defined for metrics. Valid values: ["Average", "Minimum", "Maximum"]. Default to "Average".
  • operator - Alarm comparison operator. Valid values: ["<=", "<", ">", ">=", "==", "!="]. Default to "==".
  • threshold - (Required) Alarm threshold value, which must be a numeric value currently.
  • triggered_count - Number of consecutive times it has been detected that the values exceed the threshold. Default to 3.
  • contact_groups - (Required) List contact groups of the alarm rule, which must have been created on the console.
  • start_time - Start time of the alarm effective period. Default to 0 and it indicates the time 00:00. Valid value range: [0, 24].
  • end_time - End time of the alarm effective period. Default value 24 and it indicates the time 24:00. Valid value range: [0, 24].
  • silence_time - Notification silence period in the alarm state, in seconds. Valid value range: [300, 86400]. Default to 86400
  • notify_type - Notification type. Valid value [0, 1]. The value 0 indicates TradeManager+email, and the value 1 indicates that TradeManager+email+SMS
  • enabled - Whether to enable alarm rule. Default to true.

Attributes Reference

The following attributes are exported:

Import

Alarm rule can be imported using the id, e.g.

$ terraform import alicloud_cms_alarm.alarm abc12345

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/alicloud/r/cms_alarm.html