Join us at the Cloud Engineering Summit on October 20th for a free day of learning. Save your spot.

getNetwork

docker.Network provides details about a specific Docker Network.

Schema

Required

  • name (String) The name of the Docker network.

Read-Only

  • driver (String) The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See network docs for more details.
  • id (String) The ID of this resource.
  • internal (Boolean) If true, the network is internal.
  • ipam_config (Set of Object) The IPAM configuration options (see below for nested schema)
  • options (Map of String) Only available with bridge networks. See bridge options docs for more details.
  • scope (String) Scope of the network. One of swarm, global, or local.

Nested Schema for ipam_config

Read-Only:

  • aux_address (Map of String)
  • gateway (String)
  • ip_range (String)
  • subnet (String)

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/v3/go/docker"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := docker.LookupNetwork(ctx, &docker.LookupNetworkArgs{
			Name: "main",
		}, 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(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:

Name string
Name string
name string
name str

getNetwork Result

The following output properties are available:

Driver string
Id string
Internal bool
IpamConfigs List<GetNetworkIpamConfig>
Name string
Options Dictionary<string, object>
Scope string
Driver string
Id string
Internal bool
IpamConfigs []GetNetworkIpamConfig
Name string
Options map[string]interface{}
Scope string
driver string
id string
internal boolean
ipamConfigs GetNetworkIpamConfig[]
name string
options {[key: string]: any}
scope string
driver str
id str
internal bool
ipam_configs Sequence[GetNetworkIpamConfig]
name str
options Mapping[str, Any]
scope 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.