gprd-monitoring-url-map.tf 1.94 KB
Newer Older
1 2 3 4 5 6 7
###########################################################
# This is specific to the gprd environment
# and defines the mapping from monitoring hosts to backend
# services

resource "google_compute_url_map" "monitoring-lb" {
  name            = "${format("%v-monitoring-lb", var.environment)}"
John Jarvis's avatar
John Jarvis committed
8
  default_service = "${module.prometheus.google_compute_backend_service_self_link}"
9 10

  host_rule {
John Jarvis's avatar
John Jarvis committed
11
    hosts        = ["prometheus.gprd.gitlab.net"]
12 13
    path_matcher = "prometheus"
  }
John Jarvis's avatar
John Jarvis committed
14

15 16 17 18 19 20 21 22 23 24 25 26 27
  path_matcher {
    name            = "prometheus"
    default_service = "${module.prometheus.google_compute_backend_service_self_link}"

    path_rule {
      paths   = ["/*"]
      service = "${module.prometheus.google_compute_backend_service_self_link}"
    }
  }

  ###################################

  host_rule {
John Jarvis's avatar
John Jarvis committed
28
    hosts        = ["prometheus-app.gprd.gitlab.net"]
29 30 31 32 33 34 35 36 37 38 39 40 41 42
    path_matcher = "prometheus-app"
  }
  path_matcher {
    name            = "prometheus-app"
    default_service = "${module.prometheus-app.google_compute_backend_service_self_link}"

    path_rule {
      paths   = ["/*"]
      service = "${module.prometheus-app.google_compute_backend_service_self_link}"
    }
  }

  ###################################

Yun Guo's avatar
Yun Guo committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
  host_rule {
    hosts        = ["prometheus-db.gprd.gitlab.net"]
    path_matcher = "prometheus-db"
  }
  path_matcher {
    name            = "prometheus-db"
    default_service = "${module.prometheus-db.google_compute_backend_service_self_link}"

    path_rule {
      paths   = ["/*"]
      service = "${module.prometheus-db.google_compute_backend_service_self_link}"
    }
  }

  ###################################

59
  host_rule {
John Jarvis's avatar
John Jarvis committed
60
    hosts        = ["alerts.gprd.gitlab.net"]
John Jarvis's avatar
John Jarvis committed
61 62 63 64 65 66 67 68 69 70 71
    path_matcher = "alerts"
  }
  path_matcher {
    name            = "alerts"
    default_service = "${module.alerts.google_compute_backend_service_self_link}"

    path_rule {
      paths   = ["/*"]
      service = "${module.alerts.google_compute_backend_service_self_link}"
    }
  }
72
}