Skip to content

Commit

Permalink
docs: Improves description for amrs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenHanZhang committed Dec 5, 2024
1 parent 49d595b commit 845e0b5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 12 deletions.
58 changes: 48 additions & 10 deletions website/docs/d/arms_dispatch_rules.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,56 @@ This data source provides the Arms Dispatch Rules of the current Alibaba Cloud u
Basic Usage

```terraform
data "alicloud_arms_dispatch_rules" "ids" {}
output "arms_dispatch_rule_id_1" {
value = data.alicloud_arms_dispatch_rules.ids.rules.0.id
resource "alicloud_arms_alert_contact" "default" {
alert_contact_name = "example_value"
email = "example_value@aaa.com"
}
data "alicloud_arms_dispatch_rules" "nameRegex" {
name_regex = "^my-DispatchRule"
resource "alicloud_arms_alert_contact_group" "default" {
alert_contact_group_name = "example_value"
contact_ids = [alicloud_arms_alert_contact.default.id]
}
output "arms_dispatch_rule_id_2" {
value = data.alicloud_arms_dispatch_rules.nameRegex.rules.0.id
resource "alicloud_arms_dispatch_rule" "default" {
dispatch_rule_name = "example_value"
dispatch_type = "CREATE_ALERT"
group_rules {
group_wait_time = 5
group_interval = 15
repeat_interval = 100
grouping_fields = ["alertname"]
}
label_match_expression_grid {
label_match_expression_groups {
label_match_expressions {
key = "_aliyun_arms_involvedObject_kind"
value = "app"
operator = "eq"
}
}
}
notify_rules {
notify_objects {
notify_object_id = alicloud_arms_alert_contact.default.id
notify_type = "ARMS_CONTACT"
name = "example_value"
}
notify_objects {
notify_object_id = alicloud_arms_alert_contact_group.default.id
notify_type = "ARMS_CONTACT_GROUP"
name = "example_value"
}
notify_channels = ["dingTalk", "wechat"]
notify_start_time = "10:00"
notify_end_time = "23:00"
}
}
data "alicloud_arms_dispatch_rules" "ids" {}
output "arms_dispatch_rule_id_1" {
value = data.alicloud_arms_dispatch_rules.ids.rules.0.id
}
```

## Argument Reference
Expand Down Expand Up @@ -68,8 +106,8 @@ The following attributes are exported in addition to the arguments listed above:

* `notify_rules` - Sets the notification rule.
* `notify_channels` - A list of notification methods.
* `notify_start_time` - Start time of notification.
* `notify_end_time` - End time of notification.
* `notify_start_time` - (Available since v1.237.0) Start time of notification.
* `notify_end_time` - (Available since v1.237.0) End time of notification.
* `notify_objects` - Sets the notification object.
* `notify_object_id` - The ID of the contact or contact group.
* `name` - The name of the contact or contact group.
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/arms_dispatch_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ The notify_rules supports the following:

* `notify_objects` - (Required) Sets the notification object. See [`notify_objects`](#notify_rules-notify_objects) below.
* `notify_channels` - (Required, List<String>) The notification method. Valid values: dingTalk, sms, webhook, email, and wechat.
* `notify_start_time` - (Required) Start time of notification.
* `notify_end_time` - (Required) End time of notification.
* `notify_start_time` - (Required, Available since v1.237.0) Start time of notification.
* `notify_end_time` - (Required, Available since v1.237.0) End time of notification.

### `notify_rules-notify_objects`
The notify_objects supports the following:
Expand Down

0 comments on commit 845e0b5

Please sign in to comment.