docker.Network
Explore with Pulumi AI
docker.Network
provides a docker network resource.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Docker = Pulumi.Docker;
return await Deployment.RunAsync(() =>
{
var privateNetwork = new Docker.Network("privateNetwork");
});
package main
import (
"github.com/pulumi/pulumi-docker/sdk/v4/go/docker"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := docker.NewNetwork(ctx, "privateNetwork", nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.docker.Network;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var privateNetwork = new Network("privateNetwork");
}
}
import pulumi
import pulumi_docker as docker
private_network = docker.Network("privateNetwork")
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";
const privateNetwork = new docker.Network("privateNetwork", {});
resources:
privateNetwork:
type: docker:Network
Create Network Resource
new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);
@overload
def Network(resource_name: str,
opts: Optional[ResourceOptions] = None,
attachable: Optional[bool] = None,
check_duplicate: Optional[bool] = None,
driver: Optional[str] = None,
ingress: Optional[bool] = None,
internal: Optional[bool] = None,
ipam_configs: Optional[Sequence[NetworkIpamConfigArgs]] = None,
ipam_driver: Optional[str] = None,
ipam_options: Optional[Mapping[str, Any]] = None,
ipv6: Optional[bool] = None,
labels: Optional[Sequence[NetworkLabelArgs]] = None,
name: Optional[str] = None,
options: Optional[Mapping[str, Any]] = None)
@overload
def Network(resource_name: str,
args: Optional[NetworkArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: docker:Network
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Network Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Network resource accepts the following input properties:
- Attachable bool
Enable manual container attachment to the network.
- Check
Duplicate bool Requests daemon to check for networks with same name.
- Driver string
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- Ingress bool
Create swarm routing-mesh network. Defaults to
false
.- Internal bool
Whether the network is internal.
- Ipam
Configs List<NetworkIpam Config> The IPAM configuration options
- Ipam
Driver string Driver used by the custom IP scheme of the network. Defaults to
default
- Ipam
Options Dictionary<string, object> Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- Ipv6 bool
Enable IPv6 networking. Defaults to
false
.- Labels
List<Network
Label> User-defined key/value metadata
- Name string
The name of the Docker network.
- Options Dictionary<string, object>
Only available with bridge networks. See bridge options docs for more details.
- Attachable bool
Enable manual container attachment to the network.
- Check
Duplicate bool Requests daemon to check for networks with same name.
- Driver string
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- Ingress bool
Create swarm routing-mesh network. Defaults to
false
.- Internal bool
Whether the network is internal.
- Ipam
Configs []NetworkIpam Config Args The IPAM configuration options
- Ipam
Driver string Driver used by the custom IP scheme of the network. Defaults to
default
- Ipam
Options map[string]interface{} Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- Ipv6 bool
Enable IPv6 networking. Defaults to
false
.- Labels
[]Network
Label Args User-defined key/value metadata
- Name string
The name of the Docker network.
- Options map[string]interface{}
Only available with bridge networks. See bridge options docs for more details.
- attachable Boolean
Enable manual container attachment to the network.
- check
Duplicate Boolean Requests daemon to check for networks with same name.
- driver String
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress Boolean
Create swarm routing-mesh network. Defaults to
false
.- internal Boolean
Whether the network is internal.
- ipam
Configs List<NetworkIpam Config> The IPAM configuration options
- ipam
Driver String Driver used by the custom IP scheme of the network. Defaults to
default
- ipam
Options Map<String,Object> Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 Boolean
Enable IPv6 networking. Defaults to
false
.- labels
List<Network
Label> User-defined key/value metadata
- name String
The name of the Docker network.
- options Map<String,Object>
Only available with bridge networks. See bridge options docs for more details.
- attachable boolean
Enable manual container attachment to the network.
- check
Duplicate boolean Requests daemon to check for networks with same name.
- driver string
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress boolean
Create swarm routing-mesh network. Defaults to
false
.- internal boolean
Whether the network is internal.
- ipam
Configs NetworkIpam Config[] The IPAM configuration options
- ipam
Driver string Driver used by the custom IP scheme of the network. Defaults to
default
- ipam
Options {[key: string]: any} Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 boolean
Enable IPv6 networking. Defaults to
false
.- labels
Network
Label[] User-defined key/value metadata
- name string
The name of the Docker network.
- options {[key: string]: any}
Only available with bridge networks. See bridge options docs for more details.
- attachable bool
Enable manual container attachment to the network.
- check_
duplicate bool Requests daemon to check for networks with same name.
- driver str
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress bool
Create swarm routing-mesh network. Defaults to
false
.- internal bool
Whether the network is internal.
- ipam_
configs Sequence[NetworkIpam Config Args] The IPAM configuration options
- ipam_
driver str Driver used by the custom IP scheme of the network. Defaults to
default
- ipam_
options Mapping[str, Any] Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 bool
Enable IPv6 networking. Defaults to
false
.- labels
Sequence[Network
Label Args] User-defined key/value metadata
- name str
The name of the Docker network.
- options Mapping[str, Any]
Only available with bridge networks. See bridge options docs for more details.
- attachable Boolean
Enable manual container attachment to the network.
- check
Duplicate Boolean Requests daemon to check for networks with same name.
- driver String
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress Boolean
Create swarm routing-mesh network. Defaults to
false
.- internal Boolean
Whether the network is internal.
- ipam
Configs List<Property Map> The IPAM configuration options
- ipam
Driver String Driver used by the custom IP scheme of the network. Defaults to
default
- ipam
Options Map<Any> Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 Boolean
Enable IPv6 networking. Defaults to
false
.- labels List<Property Map>
User-defined key/value metadata
- name String
The name of the Docker network.
- options Map<Any>
Only available with bridge networks. See bridge options docs for more details.
Outputs
All input properties are implicitly available as output properties. Additionally, the Network resource produces the following output properties:
Look up Existing Network Resource
Get an existing Network resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NetworkState, opts?: CustomResourceOptions): Network
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
attachable: Optional[bool] = None,
check_duplicate: Optional[bool] = None,
driver: Optional[str] = None,
ingress: Optional[bool] = None,
internal: Optional[bool] = None,
ipam_configs: Optional[Sequence[NetworkIpamConfigArgs]] = None,
ipam_driver: Optional[str] = None,
ipam_options: Optional[Mapping[str, Any]] = None,
ipv6: Optional[bool] = None,
labels: Optional[Sequence[NetworkLabelArgs]] = None,
name: Optional[str] = None,
options: Optional[Mapping[str, Any]] = None,
scope: Optional[str] = None) -> Network
func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Attachable bool
Enable manual container attachment to the network.
- Check
Duplicate bool Requests daemon to check for networks with same name.
- Driver string
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- Ingress bool
Create swarm routing-mesh network. Defaults to
false
.- Internal bool
Whether the network is internal.
- Ipam
Configs List<NetworkIpam Config> The IPAM configuration options
- Ipam
Driver string Driver used by the custom IP scheme of the network. Defaults to
default
- Ipam
Options Dictionary<string, object> Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- Ipv6 bool
Enable IPv6 networking. Defaults to
false
.- Labels
List<Network
Label> User-defined key/value metadata
- Name string
The name of the Docker network.
- Options Dictionary<string, object>
Only available with bridge networks. See bridge options docs for more details.
- Scope string
Scope of the network. One of
swarm
,global
, orlocal
.
- Attachable bool
Enable manual container attachment to the network.
- Check
Duplicate bool Requests daemon to check for networks with same name.
- Driver string
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- Ingress bool
Create swarm routing-mesh network. Defaults to
false
.- Internal bool
Whether the network is internal.
- Ipam
Configs []NetworkIpam Config Args The IPAM configuration options
- Ipam
Driver string Driver used by the custom IP scheme of the network. Defaults to
default
- Ipam
Options map[string]interface{} Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- Ipv6 bool
Enable IPv6 networking. Defaults to
false
.- Labels
[]Network
Label Args User-defined key/value metadata
- Name string
The name of the Docker network.
- Options map[string]interface{}
Only available with bridge networks. See bridge options docs for more details.
- Scope string
Scope of the network. One of
swarm
,global
, orlocal
.
- attachable Boolean
Enable manual container attachment to the network.
- check
Duplicate Boolean Requests daemon to check for networks with same name.
- driver String
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress Boolean
Create swarm routing-mesh network. Defaults to
false
.- internal Boolean
Whether the network is internal.
- ipam
Configs List<NetworkIpam Config> The IPAM configuration options
- ipam
Driver String Driver used by the custom IP scheme of the network. Defaults to
default
- ipam
Options Map<String,Object> Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 Boolean
Enable IPv6 networking. Defaults to
false
.- labels
List<Network
Label> User-defined key/value metadata
- name String
The name of the Docker network.
- options Map<String,Object>
Only available with bridge networks. See bridge options docs for more details.
- scope String
Scope of the network. One of
swarm
,global
, orlocal
.
- attachable boolean
Enable manual container attachment to the network.
- check
Duplicate boolean Requests daemon to check for networks with same name.
- driver string
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress boolean
Create swarm routing-mesh network. Defaults to
false
.- internal boolean
Whether the network is internal.
- ipam
Configs NetworkIpam Config[] The IPAM configuration options
- ipam
Driver string Driver used by the custom IP scheme of the network. Defaults to
default
- ipam
Options {[key: string]: any} Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 boolean
Enable IPv6 networking. Defaults to
false
.- labels
Network
Label[] User-defined key/value metadata
- name string
The name of the Docker network.
- options {[key: string]: any}
Only available with bridge networks. See bridge options docs for more details.
- scope string
Scope of the network. One of
swarm
,global
, orlocal
.
- attachable bool
Enable manual container attachment to the network.
- check_
duplicate bool Requests daemon to check for networks with same name.
- driver str
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress bool
Create swarm routing-mesh network. Defaults to
false
.- internal bool
Whether the network is internal.
- ipam_
configs Sequence[NetworkIpam Config Args] The IPAM configuration options
- ipam_
driver str Driver used by the custom IP scheme of the network. Defaults to
default
- ipam_
options Mapping[str, Any] Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 bool
Enable IPv6 networking. Defaults to
false
.- labels
Sequence[Network
Label Args] User-defined key/value metadata
- name str
The name of the Docker network.
- options Mapping[str, Any]
Only available with bridge networks. See bridge options docs for more details.
- scope str
Scope of the network. One of
swarm
,global
, orlocal
.
- attachable Boolean
Enable manual container attachment to the network.
- check
Duplicate Boolean Requests daemon to check for networks with same name.
- driver String
The driver of the Docker network. Possible values are
bridge
,host
,overlay
,macvlan
. See network docs for more details.- ingress Boolean
Create swarm routing-mesh network. Defaults to
false
.- internal Boolean
Whether the network is internal.
- ipam
Configs List<Property Map> The IPAM configuration options
- ipam
Driver String Driver used by the custom IP scheme of the network. Defaults to
default
- ipam
Options Map<Any> Provide explicit options to the IPAM driver. Valid options vary with
ipam_driver
and refer to that driver's documentation for more details.- ipv6 Boolean
Enable IPv6 networking. Defaults to
false
.- labels List<Property Map>
User-defined key/value metadata
- name String
The name of the Docker network.
- options Map<Any>
Only available with bridge networks. See bridge options docs for more details.
- scope String
Scope of the network. One of
swarm
,global
, orlocal
.
Supporting Types
NetworkIpamConfig, NetworkIpamConfigArgs
- Aux
Address Dictionary<string, object> Auxiliary IPv4 or IPv6 addresses used by Network driver
- Gateway string
The IP address of the gateway
- Ip
Range string The ip range in CIDR form
- Subnet string
The subnet in CIDR form
- Aux
Address map[string]interface{} Auxiliary IPv4 or IPv6 addresses used by Network driver
- Gateway string
The IP address of the gateway
- Ip
Range string The ip range in CIDR form
- Subnet string
The subnet in CIDR form
- aux
Address Map<String,Object> Auxiliary IPv4 or IPv6 addresses used by Network driver
- gateway String
The IP address of the gateway
- ip
Range String The ip range in CIDR form
- subnet String
The subnet in CIDR form
- aux
Address {[key: string]: any} Auxiliary IPv4 or IPv6 addresses used by Network driver
- gateway string
The IP address of the gateway
- ip
Range string The ip range in CIDR form
- subnet string
The subnet in CIDR form
- aux_
address Mapping[str, Any] Auxiliary IPv4 or IPv6 addresses used by Network driver
- gateway str
The IP address of the gateway
- ip_
range str The ip range in CIDR form
- subnet str
The subnet in CIDR form
- aux
Address Map<Any> Auxiliary IPv4 or IPv6 addresses used by Network driver
- gateway String
The IP address of the gateway
- ip
Range String The ip range in CIDR form
- subnet String
The subnet in CIDR form
NetworkLabel, NetworkLabelArgs
Import
Example Assuming you created a network
as follows #!/bin/bash docker network create foo prints the long ID 87b57a9b91ecab2db2a6dbf38df74c67d7c7108cbe479d6576574ec2cd8c2d73 you provide the definition for the resource as follows terraform resource “docker_network” “foo” {
name = “foo” } then the import command is as follows #!/bin/bash
$ pulumi import docker:index/network:Network foo 87b57a9b91ecab2db2a6dbf38df74c67d7c7108cbe479d6576574ec2cd8c2d73
Package Details
- Repository
- Docker pulumi/pulumi-docker
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
docker
Terraform Provider.