Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: modify doc #2527

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/2527.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_monitor_tmp_exporter_integration: Documentation example added.
```
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}
```
62 changes: 62 additions & 0 deletions website/docs/r/monitor_tmp_exporter_integration.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading