ebogdum/terraform-provider-routeros

GitHub: ebogdum/terraform-provider-routeros

Stars: 2 | Forks: 0

# Terraform Provider for MikroTik RouterOS 7 [![Terraform Registry](https://img.shields.io/badge/terraform-registry-7B42BC?logo=terraform&logoColor=white)](https://registry.terraform.io/providers/ebogdum/routeros/latest) [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE) [![Go Reference](https://pkg.go.dev/badge/github.com/ebogdum/terraform-provider-routeros.svg)](https://pkg.go.dev/github.com/ebogdum/terraform-provider-routeros) Manage MikroTik **RouterOS 7.x** devices as code with Terraform. Complete coverage of every device menu -- **420 menus, 182 resources, 276 data sources, 75 actions, 3289 properties** -- generated from a schema validated property-by-property against a live router. Manage one MikroTik router or an entire fleet from a single Terraform configuration. Apply firewall rules in deterministic order, import existing device state, detect and correct out-of-band drift, and ship secrets safely through the plugin framework's sensitive-value handling. ## Table of contents - [Why this provider](#why-this-provider) - [Quick start](#quick-start) - [Multi-router fleet management](#multi-router-fleet-management) - [Coverage](#coverage) - [Safety guards](#safety-guards) - [Drift detection and reconciliation](#drift-detection-and-reconciliation) - [Resources, data sources, and actions](#resources-data-sources-and-actions) - [Authentication and TLS](#authentication-and-tls) - [Development](#development) - [Release process](#release-process) - [Release history](#release-history) - [License](#license) ## Why this provider | Feature | This provider | |---|---| | RouterOS API | REST (HTTPS) | | Menu coverage | 420 menus (every menu surfaced over REST) | | Resources / data sources / actions | 182 / 276 / 75 | | Multi-router from one provider block | Yes (named map, no provider aliases) | | Deterministic firewall ordering | Yes (`position` integer; stable across destroy/recreate) | | Lockout safety guards | Firewall, user, user-group, mac-server | | Sensitive field redaction | 28 properties marked sensitive | | Out-of-band drift detection | Yes (verified end-to-end) | | Terraform import | Yes (`/<.id>` format) | | Schema source | Live device + WebFig skin files + Confluence docs + per-property device validation | | Plugin framework | terraform-plugin-framework (v1.19.0) | | Minimum Terraform | 1.4 | | Minimum RouterOS | 7.1 (REST API requirement) | ## Quick start terraform { required_providers { routeros = { source = "ebogdum/routeros" version = "~> 1.0" } } } provider "routeros" { host = "https://192.0.2.1" username = "admin" password = var.routeros_password insecure = true # set to false in production with a real cert } resource "routeros_ip_address" "lan" { address = "192.168.88.1/24" interface = "bridge1" comment = "Managed by Terraform" } resource "routeros_ip_firewall_filter" "allow_established" { chain = "input" action = "accept" connection_state = "established,related" position = 100 comment = "Managed by Terraform" lockout_ack = true } `terraform init && terraform apply` and you are done. ### Install for local development # 1. Build the provider binary make build # 2. Tell Terraform to use the local binary instead of the registry cat > ~/.terraformrc <
标签:EVTX分析