Network Args
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/v4/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
})
}
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.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", NetworkArgs.builder()
.name("my_network")
.build());
}
}
resources:
privateNetwork:
type: docker:Network
name: private_network
properties:
name: my_network
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
Constructors
Properties
Enable manual container attachment to the network.
Requests daemon to check for networks with same name.
The driver of the Docker network. Possible values are bridge
, host
, overlay
, macvlan
. See network docs for more details.
The IPAM configuration options
Driver used by the custom IP scheme of the network. Defaults to default
Provide explicit options to the IPAM driver. Valid options vary with ipam_driver
and refer to that driver's documentation for more details.
User-defined key/value metadata