Terraform provider reference / resources / router_openvpn
fiberax_router_openvpn (Resource)
The OpenVPN tunnel of a ROUTER. ONE per router; the only thing you set is enabled. Device certificates are issued by a certificate authority the platform keeps for this router: the first switch-on creates it and takes a few seconds.
Switching the tunnel on when it is already on is harmless and USEFUL: it pushes the routes of networks attached to the router since (networks_missing) and the certificate revocation list. The provider tells you when that is needed; do it with terraform apply -replace=<this resource> (destroy touches nothing, create sends the switch-on).
The resource has no create and no delete: destroying it DOES NOT TOUCH the platform - to stop the tunnel, set enabled = false explicitly. Devices are fiberax_router_openvpn_device.
Example Usage
# The OpenVPN tunnel of a ROUTER. ONE per router; you only switch it on and off.
# The first switch-on creates the certificate authority the platform keeps for
# this router.
resource "fiberax_router_openvpn" "vpn" {
server_id = fiberax_server.router.id
enabled = true
}
# Networks attached to the router AFTER the tunnel was set up are pushed to
# devices only when the tunnel is switched on again. The provider warns about
# them in the plan; re-apply the tunnel with:
# terraform apply -replace=fiberax_router_openvpn.vpn
output "openvpn_networks_missing" {
value = fiberax_router_openvpn.vpn.networks_missing
}
Schema
Required
enabled(Boolean) Whether the tunnel accepts connections. The only field you set.server_id(Number) The router. It is also the resource identifier: changing it recreates the resource.
Read-Only
configured(Boolean) The platform holds the certificate authority and device records for this router.device_count(Number) Devices currently recorded.device_limit(Number) Maximum devices on this tunnel.dns(String) DNS server pushed to devices (the router).endpoint(String) Public address and port devices connect to (203.0.113.10:1194).interface(String) Interface name inside the router (vtun90). Not set while the tunnel is off.managed(Boolean) The interface on the router matches the platform records. False means it was changed inside the router by hand.networks(List of String) Private networks of the router reachable through the tunnel.networks_missing(List of String) Networks attached to the router after the tunnel was configured and not pushed yet. Non-empty means: switch the tunnel on again (terraform apply -replace=<this resource>).port(Number) UDP port the router listens on.push_routes(List of String) Networks the router pushes to devices.router_address(String) Address of the router inside the tunnel.subnet(String) Address range of the tunnel.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# The import ID is the router's server ID: the tunnel has no ID of its own. terraform import fiberax_router_openvpn.vpn 11102
Generated from the provider schema for version 0.3.0. How to install the provider: Terraform provider.