Network class
<!-- Bug: Type and Name are switched -->
docker.Network provides a docker network resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";
const privateNetwork = new docker.Network("private_network", {name: "my_network"});
import pulumi
import pulumi_docker as docker
private_network = docker.Network("private_network", name="my_network")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Docker = Pulumi.Docker;
return await Deployment.RunAsync(() =>
{
var privateNetwork = new Docker.Network("private_network", new()
{
Name = "my_network",
});
});
package main
import (
"github.com/pulumi/pulumi-docker/sdk/v5/go/docker"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := docker.NewNetwork(ctx, "private_network", &docker.NetworkArgs{
Name: pulumi.String("my_network"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
docker = {
source = "pulumi/docker"
}
}
}
resource "docker_network" "private_network" {
name = "my_network"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.docker.Network;
import com.pulumi.docker.NetworkArgs;
import java.util.ArrayList;
import java.util.Arrays;
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", NetworkArgs.builder()
.name("my_network")
.build());
}
}
resources:
privateNetwork:
type: docker:Network
name: private_network
properties:
name: my_network
Import
!/bin/bash
$ pulumi import docker:index/network:Network foo id
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
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";
const foo = new docker.Network("foo", {name: "foo"});
import pulumi
import pulumi_docker as docker
foo = docker.Network("foo", name="foo")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Docker = Pulumi.Docker;
return await Deployment.RunAsync(() =>
{
var foo = new Docker.Network("foo", new()
{
Name = "foo",
});
});
package main
import (
"github.com/pulumi/pulumi-docker/sdk/v5/go/docker"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := docker.NewNetwork(ctx, "foo", &docker.NetworkArgs{
Name: pulumi.String("foo"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
docker = {
source = "pulumi/docker"
}
}
}
resource "docker_network" "foo" {
name = "foo"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.docker.Network;
import com.pulumi.docker.NetworkArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 foo = new Network("foo", NetworkArgs.builder()
.name("foo")
.build());
}
}
resources:
foo:
type: docker:Network
properties:
name: foo
then the import command is as follows
!/bin/bash
$ pulumi import docker:index/network:Network foo 87b57a9b91ecab2db2a6dbf38df74c67d7c7108cbe479d6576574ec2cd8c2d73
Constructors
- Network(String name, {NetworkArgs? args, CustomResourceOptions? options})
-
Creates a new Network.
nameThe Pulumi resource name.argsArguments used to configure this Network. The set of arguments for Network.optionsResource options controlling this resource's behavior. - Network.reference(String urn)
- Creates a typed reference to an existing Network resource.
Properties
-
attachable
↔ Output<
bool?> -
Enable manual container attachment to the network.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
driver
↔ Output<
String> -
The driver of the Docker network. Possible values are
bridge,host,overlay,macvlan. See network docs for more details.latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
ingress
↔ Output<
bool?> -
Create swarm routing-mesh network. Defaults to
false.latefinal -
internal
↔ Output<
bool> -
Whether the network is internal.
latefinal
-
ipamConfigs
↔ Output<
List< NetworkIpamConfig> > -
The IPAM configuration options
latefinal
-
ipamDriver
↔ Output<
String?> -
Driver used by the custom IP scheme of the network. Defaults to
defaultlatefinal -
ipamOptions
↔ Output<
Map< String, String> ?> -
Provide explicit options to the IPAM driver. Valid options vary with
ipamDriverand refer to that driver's documentation for more details.latefinal -
ipv6
↔ Output<
bool?> -
Enable IPv6 networking. Defaults to
false.latefinal - isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
labels
↔ Output<
List< NetworkLabel> ?> -
User-defined key/value metadata
latefinal
-
name
↔ Output<
String> -
The name of the Docker network.
latefinal
-
options
↔ Output<
Map< String, String> > -
Only available with bridge networks. See bridge options docs for more details.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scope
↔ Output<
String> -
Scope of the network. One of
swarm,global, orlocal.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited