feat: add more ping monitors
This commit is contained in:
@@ -51,6 +51,19 @@ locals {
|
|||||||
data.terraform_remote_state.uptime.outputs.monitor_group_staging_internal_services_id
|
data.terraform_remote_state.uptime.outputs.monitor_group_staging_internal_services_id
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Service parent group resolution for ping monitor based on environment and service type
|
||||||
|
service_ping_parent_group_id = (
|
||||||
|
local.is_prod ? (
|
||||||
|
var.service_type == "dataholder" ? data.terraform_remote_state.uptime.outputs.monitor_group_prod_dataholders_ping_id :
|
||||||
|
var.service_type == "module" ? data.terraform_remote_state.uptime.outputs.monitor_group_prod_modules_ping_id :
|
||||||
|
data.terraform_remote_state.uptime.outputs.monitor_group_prod_internal_services_ping_id
|
||||||
|
) : (
|
||||||
|
var.service_type == "dataholder" ? data.terraform_remote_state.uptime.outputs.monitor_group_staging_dataholders_ping_id :
|
||||||
|
var.service_type == "module" ? data.terraform_remote_state.uptime.outputs.monitor_group_staging_modules_ping_id :
|
||||||
|
data.terraform_remote_state.uptime.outputs.monitor_group_staging_internal_services_ping_id
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
module "vm" {
|
module "vm" {
|
||||||
@@ -107,7 +120,7 @@ resource "uptimekuma_monitor_dns" "dnu_dns" {
|
|||||||
resource "uptimekuma_monitor_ping" "ping" {
|
resource "uptimekuma_monitor_ping" "ping" {
|
||||||
name = "Ping ${var.service_name} (${var.environment})"
|
name = "Ping ${var.service_name} (${var.environment})"
|
||||||
hostname = local.ip_only
|
hostname = local.ip_only
|
||||||
parent = data.terraform_remote_state.uptime.outputs.monitor_group_ping_id
|
parent = local.service_ping_parent_group_id
|
||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
{
|
{
|
||||||
@@ -120,6 +133,7 @@ resource "uptimekuma_monitor_ping" "ping" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "uptimekuma_monitor_http" "http" {
|
resource "uptimekuma_monitor_http" "http" {
|
||||||
|
count = var.create_http_monitor ? 1 : 0
|
||||||
name = "${var.service_name} HTTP Monitoring (${var.environment})"
|
name = "${var.service_name} HTTP Monitoring (${var.environment})"
|
||||||
url = "http://${local.ip_only}${var.http_health_check_path}"
|
url = "http://${local.ip_only}${var.http_health_check_path}"
|
||||||
parent = local.service_parent_group_id
|
parent = local.service_parent_group_id
|
||||||
|
|||||||
@@ -88,8 +88,15 @@ variable "http_health_check_path" {
|
|||||||
default = "/"
|
default = "/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "create_http_monitor" {
|
||||||
|
description = "Whether to create the HTTP health check monitor"
|
||||||
|
type = bool
|
||||||
|
default = true
|
||||||
|
}
|
||||||
|
|
||||||
variable "gitea_password" {
|
variable "gitea_password" {
|
||||||
description = "API Token/Password for Gitea remote HTTP state access"
|
description = "API Token/Password for Gitea remote HTTP state access"
|
||||||
type = string
|
type = string
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user