-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
35 lines (33 loc) · 1.2 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
locals {
name = var.name_postfix == null ? var.name : format("%s-%s", var.name, var.name_postfix)
}
resource "huaweicloud_lts_keywords_alarm_rule" "alarm" {
name = var.name
alarm_level = var.level
send_notifications = var.send_notifications
keywords_requests {
keywords = var.keywords_requests.keywords
condition = var.keywords_requests.condition
number = var.keywords_requests.number
log_group_id = var.keywords_requests.log_group_id
log_stream_id = var.keywords_requests.log_stream_id
search_time_range_unit = var.keywords_requests.search_time_range_unit
search_time_range = var.keywords_requests.search_time_range
}
frequency {
type = var.frequency.type
fixed_rate_unit = var.frequency.fixed_rate_unit
fixed_rate = var.frequency.fixed_rate
}
notification_rule {
template_name = var.notification_rule.template_name
user_name = var.notification_rule.user_name
dynamic "topics" {
for_each = toset(var.notification_rule.topics)
content {
name = topics.value.name
topic_urn = topics.value.topic_urn
}
}
}
}