61 lines
No EOL
1.5 KiB
Markdown
61 lines
No EOL
1.5 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## Overview
|
|
|
|
This is a Terraform configuration for managing TowerOps network monitoring resources. It uses the custom `towerops` Terraform provider to create and manage sites and devices in the TowerOps platform.
|
|
|
|
## Commands
|
|
|
|
```bash
|
|
# Initialize Terraform (downloads provider)
|
|
terraform init
|
|
|
|
# Preview changes
|
|
terraform plan
|
|
|
|
# Apply changes
|
|
terraform apply
|
|
|
|
# Destroy all resources
|
|
terraform destroy
|
|
|
|
# Format Terraform files
|
|
terraform fmt
|
|
|
|
# Validate configuration
|
|
terraform validate
|
|
```
|
|
|
|
## Authentication
|
|
|
|
The provider requires a TowerOps API token. Set it via:
|
|
- `terraform.tfvars` file (gitignored): `towerops_api_token = "your-token"`
|
|
- Environment variable: `export TF_VAR_towerops_api_token="your-token"`
|
|
|
|
Generate tokens from TowerOps web application under Settings → API Tokens.
|
|
|
|
## Provider Resources
|
|
|
|
### towerops_site
|
|
Represents a physical location containing network devices.
|
|
|
|
Required: `name` (2-200 chars)
|
|
Optional: `location`, `snmp_community`
|
|
|
|
### towerops_device
|
|
Represents network equipment at a site.
|
|
|
|
Required: `site_id`, `name`, `ip_address`
|
|
Optional: `description`, `monitoring_enabled` (default: true), `snmp_enabled` (default: true), `snmp_version` (default: "2c"), `snmp_port` (default: 161)
|
|
|
|
Note: Changing `site_id` forces resource replacement.
|
|
|
|
## Import Existing Resources
|
|
|
|
```bash
|
|
terraform import towerops_site.example <uuid>
|
|
terraform import towerops_device.example <uuid>
|
|
```
|
|
- use opentofu |