From c2150cf20f41f133c108154881090ae8512fcbd9 Mon Sep 17 00:00:00 2001 From: arunma Date: Thu, 25 Aug 2022 22:04:23 +0800 Subject: [PATCH] docs: add example --- ...rce_tc_monitor_tmp_exporter_integration.go | 2 +- ...esource_tc_monitor_tmp_tke_alert_policy.go | 2 +- ...source_tc_monitor_tmp_tke_cluster_agent.go | 2 +- .../resource_tc_monitor_tmp_tke_config.go | 2 ++ ..._tc_monitor_tmp_tke_global_notification.go | 2 +- ...rce_tc_monitor_tmp_tke_record_rule_yaml.go | 2 +- .../resource_tc_monitor_tmp_tke_template.go | 2 +- ..._tc_monitor_tmp_tke_template_attachment.go | 2 +- ...tor_tmp_exporter_integration.html.markdown | 10 +++++- ...monitor_tmp_tke_alert_policy.html.markdown | 32 ++++++++++++++++++- ...onitor_tmp_tke_cluster_agent.html.markdown | 13 +++++++- .../r/monitor_tmp_tke_config.html.markdown | 23 ++++++++++++- ..._tmp_tke_global_notification.html.markdown | 26 ++++++++++++++- ...tor_tmp_tke_record_rule_yaml.html.markdown | 20 +++++++++++- .../r/monitor_tmp_tke_template.html.markdown | 14 +++++++- ..._tmp_tke_template_attachment.html.markdown | 11 ++++++- 16 files changed, 150 insertions(+), 15 deletions(-) diff --git a/tencentcloud/resource_tc_monitor_tmp_exporter_integration.go b/tencentcloud/resource_tc_monitor_tmp_exporter_integration.go index a32744faae..231e22b0a5 100644 --- a/tencentcloud/resource_tc_monitor_tmp_exporter_integration.go +++ b/tencentcloud/resource_tc_monitor_tmp_exporter_integration.go @@ -11,7 +11,7 @@ resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration kube_type = 1 cluster_id = "cls-bmuaukfu" } - +``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go b/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go index 5077089528..8f142accd2 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_alert_policy.go @@ -34,7 +34,7 @@ resource "tencentcloud_monitor_tmp_tke_alert_policy" "tmpAlertPolicy" { } } } - +``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_cluster_agent.go b/tencentcloud/resource_tc_monitor_tmp_tke_cluster_agent.go index eed6e5736f..856bcf773e 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_cluster_agent.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_cluster_agent.go @@ -15,7 +15,7 @@ resource "tencentcloud_monitor_tmp_tke_cluster_agent" "tmpClusterAgent" { enable_external = false } } - +``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_config.go b/tencentcloud/resource_tc_monitor_tmp_tke_config.go index 727c25e740..a86e0097f9 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_config.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_config.go @@ -25,6 +25,8 @@ resource "tencentcloud_monitor_tmp_tke_config" "foo" { config = "apiVersion: monitoring.coreos.com/v1\nkind: PodMonitor\nmetadata:\n name: pod-monitor-001\n namespace: mynamespace\n" } } + +``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go b/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go index 7e17c5ef13..8580c4a469 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_global_notification.go @@ -27,7 +27,7 @@ resource "tencentcloud_monitor_tmp_tke_global_notification" "tmpGlobalNotificati phone_arrive_notice = false } } - +``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_record_rule_yaml.go b/tencentcloud/resource_tc_monitor_tmp_tke_record_rule_yaml.go index bad8883469..68af37c0b6 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_record_rule_yaml.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_record_rule_yaml.go @@ -22,7 +22,7 @@ resource "resourceTencentCloudMonitorTmpTkeRecordRuleYaml" "foo" { record: 'apiserver_request:burnrate1d' EOT } - +``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_template.go b/tencentcloud/resource_tc_monitor_tmp_tke_template.go index 07c741d925..d4b25bfa62 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_template.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_template.go @@ -15,7 +15,7 @@ resource "tencentcloud_monitor_tmp_tke_template" "template" { } } } - +``` */ package tencentcloud diff --git a/tencentcloud/resource_tc_monitor_tmp_tke_template_attachment.go b/tencentcloud/resource_tc_monitor_tmp_tke_template_attachment.go index c37608a1f0..e669e2a3b2 100644 --- a/tencentcloud/resource_tc_monitor_tmp_tke_template_attachment.go +++ b/tencentcloud/resource_tc_monitor_tmp_tke_template_attachment.go @@ -13,7 +13,7 @@ resource "tencentcloud_monitor_tmp_tke_template_attachment" "temp_attachment" { instance_id = "prom-xxx" } } - +``` */ package tencentcloud diff --git a/website/docs/r/monitor_tmp_exporter_integration.html.markdown b/website/docs/r/monitor_tmp_exporter_integration.html.markdown index cd831691e4..dd7391c4c0 100644 --- a/website/docs/r/monitor_tmp_exporter_integration.html.markdown +++ b/website/docs/r/monitor_tmp_exporter_integration.html.markdown @@ -13,7 +13,15 @@ Provides a resource to create a monitor tmpExporterIntegration ## Example Usage - +```hcl +resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration" { + instance_id = "prom-dko9d0nu" + kind = "blackbox-exporter" + content = "{\"name\":\"test\",\"kind\":\"blackbox-exporter\",\"spec\":{\"instanceSpec\":{\"module\":\"http_get\",\"urls\":[\"xx\"]}}}" + kube_type = 1 + cluster_id = "cls-bmuaukfu" +} +``` ## Argument Reference 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 69bff1df3e..39c3d5e809 100644 --- a/website/docs/r/monitor_tmp_tke_alert_policy.html.markdown +++ b/website/docs/r/monitor_tmp_tke_alert_policy.html.markdown @@ -13,7 +13,37 @@ Provides a resource to create a tke tmpAlertPolicy ## Example Usage - +```hcl +resource "tencentcloud_monitor_tmp_tke_alert_policy" "tmpAlertPolicy" { + instance_id = "xxxxx" + alert_rule { + name = "xxx" + rules { + name = "xx" + rule = "xx" + template = "xx" + for = "xx" + labels { + name = "xx" + value = "xx" + } + annotations { + name = "xx" + value = "xx" + } + } + notification { + type = "xx" + enabled = true + alert_manager { + url = "xx" + cluster_id = "xx" + cluster_type = "xx" + } + } + } +} +``` ## Argument Reference diff --git a/website/docs/r/monitor_tmp_tke_cluster_agent.html.markdown b/website/docs/r/monitor_tmp_tke_cluster_agent.html.markdown index 9826645217..10afecddcf 100644 --- a/website/docs/r/monitor_tmp_tke_cluster_agent.html.markdown +++ b/website/docs/r/monitor_tmp_tke_cluster_agent.html.markdown @@ -13,7 +13,18 @@ Provides a resource to create a tmp tke cluster agent ## Example Usage - +```hcl +resource "tencentcloud_monitor_tmp_tke_cluster_agent" "tmpClusterAgent" { + instance_id = "prom-xxx" + + agents { + region = "ap-xxx" + cluster_type = "eks" + cluster_id = "cls-xxx" + enable_external = false + } +} +``` ## Argument Reference diff --git a/website/docs/r/monitor_tmp_tke_config.html.markdown b/website/docs/r/monitor_tmp_tke_config.html.markdown index 062f0c3203..f2ad9aa80a 100644 --- a/website/docs/r/monitor_tmp_tke_config.html.markdown +++ b/website/docs/r/monitor_tmp_tke_config.html.markdown @@ -13,7 +13,28 @@ Provides a resource to create a tke tmpPrometheusConfig ## Example Usage - +```hcl +resource "tencentcloud_monitor_tmp_tke_config" "foo" { + instance_id = "xxx" + cluster_type = "xxx" + cluster_id = "xxx" + + raw_jobs { + name = "raw_jobs_001" + config = "your config for raw_jobs_001\n" + } + + service_monitors { + name = "kube-system/service-monitor-001" # name with default namespace kube-system + config = "apiVersion: monitoring.coreos.com/v1\nkind: ServiceMonitor\nmetadata:\n name: service-monitor-001\n namespace: kube-system\n" + } + + pod_monitors { + name = "mynamespace/pod-monitor-001" # name with the specified namespace + config = "apiVersion: monitoring.coreos.com/v1\nkind: PodMonitor\nmetadata:\n name: pod-monitor-001\n namespace: mynamespace\n" + } +} +``` ## Argument Reference 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 31524aaeb5..90178e1fcb 100644 --- a/website/docs/r/monitor_tmp_tke_global_notification.html.markdown +++ b/website/docs/r/monitor_tmp_tke_global_notification.html.markdown @@ -13,7 +13,31 @@ 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 + } +} +``` ## Argument Reference diff --git a/website/docs/r/monitor_tmp_tke_record_rule_yaml.html.markdown b/website/docs/r/monitor_tmp_tke_record_rule_yaml.html.markdown index f51ad9146a..f737c1a3e2 100644 --- a/website/docs/r/monitor_tmp_tke_record_rule_yaml.html.markdown +++ b/website/docs/r/monitor_tmp_tke_record_rule_yaml.html.markdown @@ -13,7 +13,25 @@ Provides a resource to create a tke tmpRecordRule ## Example Usage - +```hcl +resource "resourceTencentCloudMonitorTmpTkeRecordRuleYaml" "foo" { + instance_id = "" + content = <<-EOT + apiVersion: monitoring.coreos.com/v1 + kind: PrometheusRule + metadata: + name: example-record + spec: + groups: + - name: kube-apiserver.rules + rules: + - expr: sum(metrics_test) + labels: + verb: read + record: 'apiserver_request:burnrate1d' + EOT +} +``` ## Argument Reference diff --git a/website/docs/r/monitor_tmp_tke_template.html.markdown b/website/docs/r/monitor_tmp_tke_template.html.markdown index 2b325d0fc5..34b282d0cb 100644 --- a/website/docs/r/monitor_tmp_tke_template.html.markdown +++ b/website/docs/r/monitor_tmp_tke_template.html.markdown @@ -13,7 +13,19 @@ Provides a resource to create a tmp tke template ## Example Usage - +```hcl +resource "tencentcloud_monitor_tmp_tke_template" "template" { + template { + name = "test" + level = "cluster" + describe = "template" + service_monitors { + name = "test" + config = "xxxxx" + } + } +} +``` ## Argument Reference diff --git a/website/docs/r/monitor_tmp_tke_template_attachment.html.markdown b/website/docs/r/monitor_tmp_tke_template_attachment.html.markdown index 36e9a42e03..11d809ef89 100644 --- a/website/docs/r/monitor_tmp_tke_template_attachment.html.markdown +++ b/website/docs/r/monitor_tmp_tke_template_attachment.html.markdown @@ -13,7 +13,16 @@ Provides a resource to create a tmp tke template attachment ## Example Usage - +```hcl +resource "tencentcloud_monitor_tmp_tke_template_attachment" "temp_attachment" { + template_id = "temp-xxx" + + targets { + region = "ap-xxx" + instance_id = "prom-xxx" + } +} +``` ## Argument Reference