No description
Wraps the new /api/v1/coverages endpoints. Schema mirrors the cnHeat mental model — antenna, frequency, height, azimuth, downtilt, radius — with cnHeat-style imperial units (height_agl_ft, radius_mi, frequency_ghz) the API converts to SI before validation. Compute is asynchronous: 'terraform apply' returns once the prediction is queued. The status / progress_pct / error_message / png_path / raster_path / computed_at fields are computed and update on 'terraform refresh' as the worker progresses through queued → computing → ready (or failed). Downstream resources that need a ready heatmap can use a terraform_data trigger that polls the status field. Resource semantics: - Create POST /api/v1/coverages (auto-queues compute) - Read GET /api/v1/coverages/:id - Update PATCH /api/v1/coverages/:id (does NOT auto-recompute) - Delete DELETE /api/v1/coverages/:id Update doesn't auto-recompute because parameter tweaks may not require a fresh heatmap; operators can call the recompute endpoint directly via the existing client method when they want fresh outputs. ImportState supported via the standard UUID passthrough. |
||
|---|---|---|
| .forgejo/workflows | ||
| docs | ||
| examples | ||
| internal/provider | ||
| .gitignore | ||
| .goreleaser.yml | ||
| .tool-versions | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
| terraform-registry-manifest.json | ||
TowerOps Terraform Provider
Terraform provider for managing TowerOps resources.
Requirements
Installation
terraform {
required_providers {
towerops = {
source = "towerops/towerops"
version = "~> 0.1"
}
}
}
Authentication
The provider requires an API token for authentication. Generate a token from the TowerOps web application under Settings → API Tokens.
provider "towerops" {
token = var.towerops_api_token
}
To use a custom API URL (e.g., for self-hosted or development):
provider "towerops" {
token = var.towerops_api_token
api_url = "https://custom.example.com"
}
You can also set the token via environment variable:
export TOWEROPS_TOKEN="your-api-token"
Resources
towerops_site
Manages a TowerOps site. Sites represent physical locations that contain devices.
resource "towerops_site" "example" {
name = "Main Office"
location = "New York, NY"
snmp_community = "public"
}
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Site name (2-200 characters) |
location |
string | No | Physical location or address |
snmp_community |
string | No | Default SNMP community string for devices |
Attributes
| Name | Description |
|---|---|
id |
Unique identifier (UUID) |
inserted_at |
Creation timestamp |
Import
terraform import towerops_site.example 550e8400-e29b-41d4-a716-446655440000
towerops_device
Manages a TowerOps device. Devices represent network equipment at a site.
resource "towerops_device" "router" {
site_id = towerops_site.example.id
name = "Core Router"
ip_address = "192.168.1.1"
monitoring_enabled = true
snmp_enabled = true
snmp_version = "2c"
snmp_port = 161
}
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
site_id |
string | Yes | - | ID of the parent site (forces replacement if changed) |
name |
string | Yes | - | Device name |
ip_address |
string | Yes | - | Device IP address |
description |
string | No | - | Device description |
monitoring_enabled |
bool | No | true |
Enable monitoring |
snmp_enabled |
bool | No | true |
Enable SNMP polling |
snmp_version |
string | No | "2c" |
SNMP version (1, 2c, or 3) |
snmp_port |
number | No | 161 |
SNMP port |
Attributes
| Name | Description |
|---|---|
id |
Unique identifier (UUID) |
inserted_at |
Creation timestamp |
Import
terraform import towerops_device.router 7c9e6679-7425-40de-944b-e07fc1f90ae7
Example
terraform {
required_providers {
towerops = {
source = "towerops/towerops"
version = "~> 0.1"
}
}
}
variable "towerops_api_token" {
type = string
sensitive = true
}
provider "towerops" {
token = var.towerops_api_token
}
resource "towerops_site" "datacenter" {
name = "Primary Datacenter"
location = "Chicago, IL"
snmp_community = "monitoring"
}
resource "towerops_device" "core_switch" {
site_id = towerops_site.datacenter.id
name = "Core Switch"
ip_address = "10.0.0.1"
description = "Main distribution switch"
snmp_enabled = true
snmp_version = "2c"
}
resource "towerops_device" "edge_router" {
site_id = towerops_site.datacenter.id
name = "Edge Router"
ip_address = "10.0.0.2"
snmp_enabled = true
snmp_version = "3"
}
output "site_id" {
value = towerops_site.datacenter.id
}
License
MPL-2.0