terraform-provider-docker/website/docs/r/network.html.markdown
Boris HUISGEN eca96b960b Add labels to support docker stacks (#92)
* Add network labels and options attachable, ingress and ipv6
* Add volume labels
* Add secret labels
* Updates documentation
2018-10-18 12:39:58 +02:00

2 KiB

layout page_title sidebar_current description
docker Docker: docker_network docs-docker-resource-network Manages a Docker Network.

docker_network

Manages a Docker Network. This can be used alongside docker_container to create virtual networks within the docker environment.

Example Usage

# Create a new docker network
resource "docker_network" "private_network" {
  name = "my_network"
}

# Access it somewhere else with ${docker_network.private_network.name}

Argument Reference

The following arguments are supported:

  • name - (Required, string) The name of the Docker network.
  • labels - (Optional, map of string/string key/value pairs) User-defined key/value metadata.
  • check_duplicate - (Optional, boolean) Requests daemon to check for networks with same name.
  • driver - (Optional, string) Name of the network driver to use. Defaults to bridge driver.
  • options - (Optional, map of strings) Network specific options to be used by the drivers.
  • internal - (Optional, boolean) Restrict external access to the network. Defaults to false.
  • attachable - (Optional, boolean) Enable manual container attachment to the network. Defaults to false.
  • ingress - (Optional, boolean) Create swarm routing-mesh network. Defaults to false.
  • ipv6 - (Optional, boolean) Enable IPv6 networking. Defaults to false.
  • ipam_driver - (Optional, string) Driver used by the custom IP scheme of the network.
  • ipam_config - (Optional, block) See IPAM config below for details.

IPAM config

Configuration of the custom IP scheme of the network.

The ipam_config block supports:

  • subnet - (Optional, string)
  • ip_range - (Optional, string)
  • gateway - (Optional, string)
  • aux_address - (Optional, map of string)

Attributes Reference

The following attributes are exported in addition to the above configuration:

  • id (string)
  • scope (string)