Skip to content

terraform-routeros/terraform-provider-routeros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

574ed79 · Mar 21, 2025
Mar 4, 2025
Mar 21, 2025
Mar 21, 2025
Mar 21, 2025
Nov 10, 2024
Feb 11, 2025
Sep 24, 2024
Dec 21, 2021
Oct 31, 2023
Mar 21, 2025
Feb 23, 2023
Dec 10, 2021
Feb 11, 2025
Sep 27, 2024
Mar 19, 2025
Mar 19, 2025
Apr 3, 2023
Mar 21, 2025

Repository files navigation

Terraform Provider RouterOS

module testing workflow

Note: In release 1.43, the resource schemas have been changed:

  • routeros_routing_bgp_connection
  • routeros_ipv6_neighbor_discovery
  • routeros_interface_wireguard_peer

For the first two to work correctly, you must remove the resource state (terraform state rm <name>) and import it again (terraform import [options] <name> <id>).

Purpose

This provider allows you to configure Mikrotik routers using old API or REST API, using or not using TLS. Compatibility testing is only performed within ROS version 7.x.

From version 1.0.0, the provider has been rewritten by vaerh, and their fork has now been merged. This version drastically improves adding new endpoints to the provider, enabling significantly easier development. vaerh has been added as a maintainer to this project.

We are not affiliated in any way with Mikrotik or the development of RouterOS

Using the provider

To get started with the provider, you first need to enable the REST API on your router. You can follow the Mikrotik documentation on this, but the gist is to create an SSL cert (in /system/certificates) and enable the web-ssl service (in /ip/services) which uses that certificate. After that, include the following in your Terraform manifests:

terraform {
  required_providers {
    routeros = {
      source = "terraform-routeros/routeros"
    }
  }
}

provider "routeros" {
  hosturl  = "(http|https|api|apis)://my.router.local[:port]"
  username = "my_username"
  password = "my_super_secret_password"
}

For more in-depth documentation about each of the resources and datasources, please read the documentation on Hashicorp's Provider registry

Versions tested

  • go 1.21 and ROS 7.12, 7.15, 7.16 (stable)

Changelog

For a detailed changelog, please see the changelog.md.

Contributing

This version of the module greatly simplifies the process of adding new resources. You are welcome!