Skip to main content
This guide connects a laptop to a Network over WireGuard, deploys a private function on the same Network, and requests the function by its private name.

Requirements

  • telnyx-edge v0.5.17 or later, authenticated with an API key
  • A laptop with WireGuard installed

Create the Network

Create the WireGuard Interface

telnyx-edge network regions --service cloud_vpn lists the regions that offer WireGuard Interfaces. Create one in ashburn-va and wait until it is provisioned:
The printed id is the WireGuard Interface UUID the function binding needs.

Add a DNS Resolver

The DNS resolver answers the private names of functions on the Network. Create it in the same region and wait until it is provisioned:
The command prints the resolver’s address on the Network, 172.27.240.14, once it is provisioned.

Create the Function

Add private = true to the [edge_compute] block of func.toml, and add the binding the interface command printed, with peer = false and ingress = true:
Function Settings explains each setting.

Ship

Host is the function’s private name. Address is the ingress it sits behind.

Connect the Laptop

Add the laptop as a WireGuard peer. The command writes a ready-to-use configuration with the private key filled in:
DNS points the laptop at the resolver while the tunnel is up. AllowedIPs routes the interface subnet and the resolver through the tunnel. Bring up the tunnel:

Request the Function by Name

The public URL returns 404:
To reach the function from every device on a Tailscale network instead of one WireGuard peer per device, add a Tailscale Subnet Router: see Tailscale.

Clean Up