terraform-routeros / terraform-provider-routeros

Terraform Provider for Mikrotik RouterOS
Mozilla Public License 2.0
191 stars 55 forks source link

routeros_interface_wireguard* does not follow the disabled pattern #566

Open n0rad opened 1 week ago

n0rad commented 1 week ago

without setting disabled on the resource, if I disable the interface on mikrotik side, terraform do not see it and do not plan to re-enable the interface.

peer is affected too.

vaerh commented 1 week ago

This is a feature of the provider's implementation. Some time ago we discussed that simultaneous resource management from TF and from outside is a very bad practice. Such behavior as you describe is a normal behavior of many attributes. It is done so to be able to use current resource schemes for different ROS versions. The solution is universal for all attributes, if you want TF to control them, you must explicitly specify their value:

resource “routeros_interface_wireguard” “test_wg_interface” {
  name         = “test_wg_interface”
  listen_port  = “13231”
  disabled     = false
}