wihan/dev

docs /dokploy / data sources

markdown
browse the dokploy docs

dokploy_network (Data Source)

Looks up a Docker network already registered in Dokploy, whether created by this provider or by the Dokploy UI (including a network imported through the UI).

data "dokploy_network" "shared" {
  name = "shared-network"
}

resource "dokploy_application" "app" {
  network_ids = [data.dokploy_network.shared.id]
  # ...
}

~> ipam is not exposed here. A consumer needs only the id to attach a service to the network; copying a shared network’s address pools into every consumer’s state widens their blast radius for no gain.

~> Network names are unique per server, not install-wide: Docker enforces the name uniquely per daemon, and on a multi-server install each remote server runs its own daemon. On a single-server install a name lookup never needs server_id to disambiguate; on a multi-server install, set server_id to disambiguate a name found on more than one server. server_id can only be set together with name, not id.

Example Usage

# Look up a network created (or imported) in the Dokploy UI.
data "dokploy_network" "shared" {
  name = "backend-net"
}

Schema

Optional

  • id (String) Network id. Set this to look it up by id, or leave it unset and set name.
  • name (String) Network name, unique per server in Dokploy. Exactly one of id or name must be set.
  • server_id (String) Id of the remote server to narrow the name lookup to. Only usable together with name; conflicts with id.

Read-Only

  • attachable (Boolean) Whether manual container attachment is allowed (overlay networks).
  • created_at (String) Creation timestamp (server-side).
  • driver (String) Network driver: bridge or overlay.
  • enable_ipv4 (Boolean) Whether IPv4 is enabled on the network.
  • enable_ipv6 (Boolean) Whether IPv6 is enabled on the network.
  • internal (Boolean) Whether external access to the network is restricted.
  • mtu (Number) MTU for the network. Null when Docker’s default applies.