-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcf_exporter.tf
40 lines (34 loc) · 1.1 KB
/
cf_exporter.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
36
37
38
39
40
resource "cloudfoundry_app" "cfpaasexporter" {
count = var.enable_cf_exporter ? 1 : 0
name = "tf-cfpaasexporter-${local.postfix}"
space = var.cf_space_id
memory = var.cf_paas_exporter_memory
disk_quota = var.cf_paas_exporter_disk_quota
docker_image = var.cf_paas_exporter_image
timeout = var.cf_paas_exporter_timeout
docker_credentials = {
username = var.docker_username
password = var.docker_password
}
environment = {
USERNAME = var.cf_functional_account.username
PASSWORD = var.cf_functional_account.password
API_ENDPOINT = var.cf_functional_account.api_endpoint
}
routes {
route = cloudfoundry_route.cfpaasexporter_internal[0].id
}
labels = {
"variant.tva/exporter" = true
}
annotations = {
"prometheus.exporter.port" = "8080"
"prometheus.exporter.path" = "/metrics"
}
}
resource "cloudfoundry_route" "cfpaasexporter_internal" {
count = var.enable_cf_exporter ? 1 : 0
domain = data.cloudfoundry_domain.apps_internal_domain.id
space = var.cf_space_id
hostname = "cfpaasexporter-${local.postfix}"
}