|
| 1 | +--- |
| 2 | +subcategory: "Monitor" |
| 3 | +layout: "tencentcloud" |
| 4 | +page_title: "TencentCloud: tencentcloud_monitor_tmp_alert_rule" |
| 5 | +sidebar_current: "docs-tencentcloud-resource-monitor_tmp_alert_rule" |
| 6 | +description: |- |
| 7 | + Provides a resource to create a monitor tmpAlertRule |
| 8 | +--- |
| 9 | + |
| 10 | +# tencentcloud_monitor_tmp_alert_rule |
| 11 | + |
| 12 | +Provides a resource to create a monitor tmpAlertRule |
| 13 | + |
| 14 | +## Example Usage |
| 15 | + |
| 16 | +```hcl |
| 17 | +resource "tencentcloud_monitor_tmp_alert_rule" "tmpAlertRule" { |
| 18 | + instance_id = "prom-c89b3b3u" |
| 19 | + rule_name = "test123" |
| 20 | + expr = "up{service=\"rig-prometheus-agent\"}>0" |
| 21 | + receivers = ["notice-l9ziyxw6"] |
| 22 | + rule_state = 2 |
| 23 | + duration = "4m" |
| 24 | + labels { |
| 25 | + key = "hello1" |
| 26 | + value = "world1" |
| 27 | + } |
| 28 | + annotations { |
| 29 | + key = "hello2" |
| 30 | + value = "world2" |
| 31 | + } |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +## Argument Reference |
| 36 | + |
| 37 | +The following arguments are supported: |
| 38 | + |
| 39 | +* `expr` - (Required) Rule expression. |
| 40 | +* `instance_id` - (Required) Instance id. |
| 41 | +* `receivers` - (Required) Alarm notification template id list. |
| 42 | +* `rule_name` - (Required) Rule name. |
| 43 | +* `annotations` - (Optional) Rule alarm duration. |
| 44 | +* `duration` - (Optional) Rule alarm duration. |
| 45 | +* `labels` - (Optional) Rule alarm duration. |
| 46 | +* `rule_state` - (Optional) Rule state code. |
| 47 | +* `type` - (Optional) Alarm Policy Template Classification. |
| 48 | + |
| 49 | +The `annotations` object supports the following: |
| 50 | + |
| 51 | +* `key` - (Required) key. |
| 52 | +* `value` - (Required) value. |
| 53 | + |
| 54 | +The `labels` object supports the following: |
| 55 | + |
| 56 | +* `key` - (Required) key. |
| 57 | +* `value` - (Required) value. |
| 58 | + |
| 59 | +## Attributes Reference |
| 60 | + |
| 61 | +In addition to all arguments above, the following attributes are exported: |
| 62 | + |
| 63 | +* `id` - ID of the resource. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +## Import |
| 68 | + |
| 69 | +monitor tmpAlertRule can be imported using the id, e.g. |
| 70 | +``` |
| 71 | +$ terraform import tencentcloud_monitor_tmp_alert_rule.tmpAlertRule instanceId#Rule_id |
| 72 | +``` |
| 73 | + |
0 commit comments