terraform-provider-towerops/examples/resources/towerops_check/resource.tf
Graham McIntire bc3dbfe419
add towerops_check resource for service check management
- new towerops_check resource supporting HTTP, TCP, DNS, and ping checks
- flat schema with type-specific fields (url, host, port, hostname, etc.)
- client CRUD methods for /api/v1/checks endpoints
- resource documentation, examples, and provider index updated
- acceptance tests for all check types, update, import, and error handling
2026-03-16 18:33:56 -05:00

32 lines
756 B
HCL

# HTTP health check
resource "towerops_check" "web_health" {
name = "Web Health Check"
check_type = "http"
url = "https://example.com/health"
expected_status = 200
content_match = "\"status\":\"ok\""
}
# TCP port check
resource "towerops_check" "radius_port" {
name = "FreeRADIUS Auth Port"
check_type = "tcp"
host = "10.0.0.5"
port = 1812
}
# DNS resolution check
resource "towerops_check" "dns_resolution" {
name = "DNS Resolution"
check_type = "dns"
hostname = "google.com"
dns_server = "10.0.0.1"
record_type = "A"
}
# Ping check
resource "towerops_check" "gateway_ping" {
name = "Gateway Reachability"
check_type = "ping"
host = "10.0.0.1"
}