diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go b/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go index 0fa46b2ad6..59b27daf5d 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go @@ -5,32 +5,26 @@ Example Usage ```hcl -resource "tencentcloud_monitor_tmp_tke_alert_policy" "tmpAlertPolicy" { - instance_id = "xxxxx" +resource "tencentcloud_monitor_tmp_tke_alert_policy" "basic" { + instance_id = "prom-xxxxxx" alert_rule { - name = "xxx" + name = "alert_rule-test" rules { - name = "xx" - rule = "xx" - template = "xx" - for = "xx" + name = "rules-test" + rule = "(count(kube_node_status_allocatable_cpu_cores) by (cluster) -1) / count(kube_node_status_allocatable_cpu_cores) by (cluster)" + template = "The CPU requested by the Pod in the cluster {{ $labels.cluster }} is overloaded, and the current CPU application ratio is {{ $value | humanizePercentage }}" + for = "5m" labels { - name = "xx" - value = "xx" - } - annotations { - name = "xx" - value = "xx" + name = "severity" + value = "warning" } } notification { - type = "xx" + type = "amp" enabled = true alert_manager { - url = "xx" - cluster_id = "xx" - cluster_type = "xx" - } + url = "xxx" + } } } } diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go b/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go index 4d3d75c8d2..22e46b3a19 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go @@ -4,28 +4,28 @@ Provides a resource to create a tmp tke global notification Example Usage ```hcl -resource "tencentcloud_monitor_tmp_tke_global_notification" "tmpGlobalNotification" { - instance_id = xxx - notification{ - enabled = true - type = "webhook" - web_hook = "" - alert_manager { - url = "" - cluster_type = "" - cluster_id = "" - } - repeat_interval = "" - time_range_start = "" - time_range_end = "" - notify_way = ["SMS", "EMAIL"] - receiver_groups = [""] - phone_notify_order = [] - phone_circle_times = xxx - phone_inner_interval = xxx - phone_circle_interval = xxx - phone_arrive_notice = false - } +resource "tencentcloud_monitor_tmp_tke_global_notification" "basic" { + instance_id = "prom-xxxxxx" + notification { + enabled = true + type = "webhook" + alert_manager { + cluster_id = "" + cluster_type = "" + url = "" + } + web_hook = "" + repeat_interval = "5m" + time_range_start = "00:00:00" + time_range_end = "23:59:59" + notify_way = ["SMS", "EMAIL"] + receiver_groups = [] + phone_notify_order = [] + phone_circle_times = 0 + phone_inner_interval = 0 + phone_circle_interval = 0 + phone_arrive_notice = false + } } ``` */ diff --git a/website/docs/r/monitor_tmp_tke_alert_policy.html.markdown b/website/docs/r/monitor_tmp_tke_alert_policy.html.markdown index 7b160ee6f1..63f2446723 100644 --- a/website/docs/r/monitor_tmp_tke_alert_policy.html.markdown +++ b/website/docs/r/monitor_tmp_tke_alert_policy.html.markdown @@ -14,31 +14,25 @@ Provides a resource to create a tke tmpAlertPolicy ## Example Usage ```hcl -resource "tencentcloud_monitor_tmp_tke_alert_policy" "tmpAlertPolicy" { - instance_id = "xxxxx" +resource "tencentcloud_monitor_tmp_tke_alert_policy" "basic" { + instance_id = "prom-xxxxxx" alert_rule { - name = "xxx" + name = "alert_rule-test" rules { - name = "xx" - rule = "xx" - template = "xx" - for = "xx" + name = "rules-test" + rule = "(count(kube_node_status_allocatable_cpu_cores) by (cluster) -1) / count(kube_node_status_allocatable_cpu_cores) by (cluster)" + template = "The CPU requested by the Pod in the cluster {{ $labels.cluster }} is overloaded, and the current CPU application ratio is {{ $value | humanizePercentage }}" + for = "5m" labels { - name = "xx" - value = "xx" - } - annotations { - name = "xx" - value = "xx" + name = "severity" + value = "warning" } } notification { - type = "xx" + type = "amp" enabled = true alert_manager { - url = "xx" - cluster_id = "xx" - cluster_type = "xx" + url = "xxx" } } } diff --git a/website/docs/r/monitor_tmp_tke_global_notification.html.markdown b/website/docs/r/monitor_tmp_tke_global_notification.html.markdown index 1d430a870b..cda22a58aa 100644 --- a/website/docs/r/monitor_tmp_tke_global_notification.html.markdown +++ b/website/docs/r/monitor_tmp_tke_global_notification.html.markdown @@ -14,26 +14,26 @@ Provides a resource to create a tmp tke global notification ## Example Usage ```hcl -resource "tencentcloud_monitor_tmp_tke_global_notification" "tmpGlobalNotification" { - instance_id = xxx +resource "tencentcloud_monitor_tmp_tke_global_notification" "basic" { + instance_id = "prom-xxxxxx" notification { - enabled = true - type = "webhook" - web_hook = "" + enabled = true + type = "webhook" alert_manager { - url = "" - cluster_type = "" cluster_id = "" + cluster_type = "" + url = "" } - repeat_interval = "" - time_range_start = "" - time_range_end = "" + web_hook = "" + repeat_interval = "5m" + time_range_start = "00:00:00" + time_range_end = "23:59:59" notify_way = ["SMS", "EMAIL"] - receiver_groups = [""] + receiver_groups = [] phone_notify_order = [] - phone_circle_times = xxx - phone_inner_interval = xxx - phone_circle_interval = xxx + phone_circle_times = 0 + phone_inner_interval = 0 + phone_circle_interval = 0 phone_arrive_notice = false } }