dokploy_network (Data Source)
Looks up a Docker network that already exists in Dokploy, whether this provider or the Dokploy UI created it. That includes a network that was imported through the UI.
data "dokploy_network" "shared" {
name = "shared-network"
}
resource "dokploy_application" "app" {
network_ids = [data.dokploy_network.shared.id]
# ...
}~> The data source does not expose ipam. A consumer needs only the id to attach a service to the network. A copy of the address pools of a shared network in the state of each consumer widens their exposure with no gain.
~> Network names are unique per server, not per Dokploy installation. Docker enforces a unique name per daemon, and on a multi-server installation each remote server runs its own daemon. On a single-server installation, a name lookup never needs server_id. On a multi-server installation, set server_id when the same name exists on more than one server. server_id is valid only together with name, not with id.
Example Usage
# Look up a network that the Dokploy UI created or imported.
data "dokploy_network" "shared" {
name = "backend-net"
}Schema
Optional
id(String) Network id. Set it for a lookup by id, or leave it unset and setname.name(String) Network name, unique per server in Dokploy. Set exactly one ofidorname.server_id(String) Id of the remote server that narrows thenamelookup. Valid only together withname. It conflicts withid.
Read-Only
attachable(Boolean) Whether manual container attachment is allowed, for overlay networks.created_at(String) Creation timestamp from the server.driver(String) Network driver:bridgeoroverlay.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 the Docker default applies.