Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getNetwork

Finds a specific docker network and returns information about it.

Example Usage

using Pulumi;
using Docker = Pulumi.Docker;

class MyStack : Stack
{
    public MyStack()
    {
        var main = Output.Create(Docker.GetNetwork.InvokeAsync(new Docker.GetNetworkArgs
        {
            Name = "main",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-docker/sdk/v2/go/docker"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "main"
        _, err := docker.LookupNetwork(ctx, &docker.LookupNetworkArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_docker as docker

main = docker.get_network(name="main")
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";

const main = pulumi.output(docker.getNetwork({
    name: "main",
}, { async: true }));

Using getNetwork

function getNetwork(args: GetNetworkArgs, opts?: InvokeOptions): Promise<GetNetworkResult>
def get_network(id: Optional[str] = None, name: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetNetworkResult
func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)

Note: This function is named LookupNetwork in the Go SDK.

public static class GetNetwork {
    public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Id string

The id of the Docker network.

Name string

The name of the Docker network.

Id string

The id of the Docker network.

Name string

The name of the Docker network.

id string

The id of the Docker network.

name string

The name of the Docker network.

id str

The id of the Docker network.

name str

The name of the Docker network.

getNetwork Result

The following output properties are available:

Driver string

(Optional, string) The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See [docker docs][networkdocs] for more details.

Internal bool
IpamConfigs List<GetNetworkIpamConfig>
Options Dictionary<string, object>

(Optional, map) Only available with bridge networks. See [docker docs][bridgeoptionsdocs] for more details. * internal (Optional, bool) Boolean flag for whether the network is internal. * ipam_config (Optional, map) See IPAM below for details. * scope (Optional, string) Scope of the network. One of swarm, global, or local.

Scope string
Id string
Name string
Driver string

(Optional, string) The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See [docker docs][networkdocs] for more details.

Internal bool
IpamConfigs []GetNetworkIpamConfig
Options map[string]interface{}

(Optional, map) Only available with bridge networks. See [docker docs][bridgeoptionsdocs] for more details. * internal (Optional, bool) Boolean flag for whether the network is internal. * ipam_config (Optional, map) See IPAM below for details. * scope (Optional, string) Scope of the network. One of swarm, global, or local.

Scope string
Id string
Name string
driver string

(Optional, string) The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See [docker docs][networkdocs] for more details.

internal boolean
ipamConfigs GetNetworkIpamConfig[]
options {[key: string]: any}

(Optional, map) Only available with bridge networks. See [docker docs][bridgeoptionsdocs] for more details. * internal (Optional, bool) Boolean flag for whether the network is internal. * ipam_config (Optional, map) See IPAM below for details. * scope (Optional, string) Scope of the network. One of swarm, global, or local.

scope string
id string
name string
driver str

(Optional, string) The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See [docker docs][networkdocs] for more details.

internal bool
ipam_configs Sequence[GetNetworkIpamConfig]
options Mapping[str, Any]

(Optional, map) Only available with bridge networks. See [docker docs][bridgeoptionsdocs] for more details. * internal (Optional, bool) Boolean flag for whether the network is internal. * ipam_config (Optional, map) See IPAM below for details. * scope (Optional, string) Scope of the network. One of swarm, global, or local.

scope str
id str
name str

Supporting Types

GetNetworkIpamConfig

AuxAddress Dictionary<string, object>
Gateway string
IpRange string
Subnet string
AuxAddress map[string]interface{}
Gateway string
IpRange string
Subnet string
auxAddress {[key: string]: any}
gateway string
ipRange string
subnet string
aux_address Mapping[str, Any]
gateway str
ip_range str
subnet str

Package Details

Repository
https://github.com/pulumi/pulumi-docker
License
Apache-2.0
Notes
This Pulumi package is based on the docker Terraform Provider.