From fbbef4069686e60b634f64ca317622c37ce009ea Mon Sep 17 00:00:00 2001 From: arunma Date: Mon, 5 Feb 2024 14:41:36 +0800 Subject: [PATCH 1/2] fix: modify doc --- ...rce_tc_monitor_tmp_exporter_integration.md | 62 +++++++++++++++++++ ...tor_tmp_exporter_integration.html.markdown | 62 +++++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/tencentcloud/services/tmp/resource_tc_monitor_tmp_exporter_integration.md b/tencentcloud/services/tmp/resource_tc_monitor_tmp_exporter_integration.md index 9fb04b7d16..f21c73fe05 100644 --- a/tencentcloud/services/tmp/resource_tc_monitor_tmp_exporter_integration.md +++ b/tencentcloud/services/tmp/resource_tc_monitor_tmp_exporter_integration.md @@ -47,4 +47,66 @@ resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration cluster_id = "" kube_type = 3 } +``` + +Integration Center: CVM Scrape Job + +``` +resource "tencentcloud_vpc" "vpc" { + name = "tf-eks-vpc" + cidr_block = "10.2.0.0/16" +} + +resource "tencentcloud_subnet" "sub" { + vpc_id = tencentcloud_vpc.vpc.id + name = "tf-as-subnet" + cidr_block = "10.2.11.0/24" + availability_zone = "ap-guangzhou-3" +} + +resource "tencentcloud_monitor_tmp_instance" "tmpInstance" { + instance_name = "tf-test-tmp" + vpc_id = tencentcloud_vpc.vpc.id + subnet_id = tencentcloud_subnet.sub.id + data_retention_time = 15 + zone = "ap-guangzhou-3" + tags = { + "createdBy" = "terraform" + } +} + +# Integration Center: CVM Scrape Job +resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration" { + instance_id = tencentcloud_monitor_tmp_instance.tmpInstance.id + kind = "cvm-http-sd-exporter" + content = jsonencode({ + "kind": "cvm-http-sd-exporter", + "spec": { + "job": <<-EOT + job_name: example-cvm-job-name + metrics_path: /metrics + cvm_sd_configs: + - region: ap-guangzhou + ports: + - 9100 + filters: + - name: tag:YOUR_TAG_KEY + values: + - YOUR_TAG_VALUE + relabel_configs: + - source_labels: [__meta_cvm_instance_state] + regex: RUNNING + action: keep + - regex: __meta_cvm_tag_(.*) + replacement: $1 + action: labelmap + - source_labels: [__meta_cvm_region] + target_label: region + action: replace + EOT + } + }) + kube_type = 3 + cluster_id = "" +} ``` \ No newline at end of file diff --git a/website/docs/r/monitor_tmp_exporter_integration.html.markdown b/website/docs/r/monitor_tmp_exporter_integration.html.markdown index d36296027e..9ac11263dd 100644 --- a/website/docs/r/monitor_tmp_exporter_integration.html.markdown +++ b/website/docs/r/monitor_tmp_exporter_integration.html.markdown @@ -60,6 +60,68 @@ resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration } ``` +### Integration Center: CVM Scrape Job + +```hcl +resource "tencentcloud_vpc" "vpc" { + name = "tf-eks-vpc" + cidr_block = "10.2.0.0/16" +} + +resource "tencentcloud_subnet" "sub" { + vpc_id = tencentcloud_vpc.vpc.id + name = "tf-as-subnet" + cidr_block = "10.2.11.0/24" + availability_zone = "ap-guangzhou-3" +} + +resource "tencentcloud_monitor_tmp_instance" "tmpInstance" { + instance_name = "tf-test-tmp" + vpc_id = tencentcloud_vpc.vpc.id + subnet_id = tencentcloud_subnet.sub.id + data_retention_time = 15 + zone = "ap-guangzhou-3" + tags = { + "createdBy" = "terraform" + } +} + +# Integration Center: CVM Scrape Job +resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration" { + instance_id = tencentcloud_monitor_tmp_instance.tmpInstance.id + kind = "cvm-http-sd-exporter" + content = jsonencode({ + "kind" : "cvm-http-sd-exporter", + "spec" : { + "job" : <<-EOT + job_name: example-cvm-job-name + metrics_path: /metrics + cvm_sd_configs: + - region: ap-guangzhou + ports: + - 9100 + filters: + - name: tag:YOUR_TAG_KEY + values: + - YOUR_TAG_VALUE + relabel_configs: + - source_labels: [__meta_cvm_instance_state] + regex: RUNNING + action: keep + - regex: __meta_cvm_tag_(.*) + replacement: $1 + action: labelmap + - source_labels: [__meta_cvm_region] + target_label: region + action: replace + EOT + } + }) + kube_type = 3 + cluster_id = "" +} +``` + ## Argument Reference The following arguments are supported: From 203fb90627ef2e8887f25031cdd909a7e151a61f Mon Sep 17 00:00:00 2001 From: arunma Date: Wed, 7 Feb 2024 17:45:25 +0800 Subject: [PATCH 2/2] feat: add changlog --- .changelog/2527.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/2527.txt diff --git a/.changelog/2527.txt b/.changelog/2527.txt new file mode 100644 index 0000000000..01b2e0a649 --- /dev/null +++ b/.changelog/2527.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_monitor_tmp_exporter_integration: Documentation example added. +``` \ No newline at end of file