mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-02-02 11:49:29 -05:00
Some checks are pending
Acc Tests / acc-test (TestAccDockerConfig, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerConfig, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerNetwork, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerNetwork, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerPlugin, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerPlugin, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerSecret, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerSecret, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerTag, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerTag, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerVolume, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (TestAccDockerVolume, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerContainer, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerContainer, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerImage, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerImage, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerRegistryImage, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerRegistryImage, 1.8.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerService, 0.15.x) (push) Waiting to run
Acc Tests / acc-test (true, TestAccDockerService, 1.8.x) (push) Waiting to run
Compile Binaries / compile-fast (push) Waiting to run
Compile Binaries / compile (push) Waiting to run
golangci-lint / lint (push) Waiting to run
Unit Tests / unit-test (push) Waiting to run
Website Checks / markdown-link-check (push) Waiting to run
Docs and Website Lint / website-generation (push) Waiting to run
Docs and Website Lint / website-lint-spellcheck-tffmt (push) Waiting to run
Docs and Website Lint / markdown-lint (push) Waiting to run
2.9 KiB
2.9 KiB
| page_title | subcategory | description |
|---|---|---|
| Resource docker_network - terraform-provider-docker | docker_network provides a docker network resource. |
Resource (docker_network)
docker_network provides a docker network resource.
Example Usage
resource "docker_network" "private_network" {
name = "my_network"
}
Schema
Required
name(String) The name of the Docker network.
Optional
attachable(Boolean) Enable manual container attachment to the network.driver(String) The driver of the Docker network. Possible values arebridge,host,overlay,macvlan. See network docs for more details.ingress(Boolean) Create swarm routing-mesh network. Defaults tofalse.internal(Boolean) Whether the network is internal.ipam_config(Block Set) The IPAM configuration options (see below for nested schema)ipam_driver(String) Driver used by the custom IP scheme of the network. Defaults todefaultipam_options(Map of String) Provide explicit options to the IPAM driver. Valid options vary withipam_driverand refer to that driver's documentation for more details.ipv6(Boolean) Enable IPv6 networking. Defaults tofalse.labels(Block Set) User-defined key/value metadata (see below for nested schema)options(Map of String) Only available with bridge networks. See bridge options docs for more details.
Read-Only
id(String) The ID of this resource.scope(String) Scope of the network. One ofswarm,global, orlocal.
Nested Schema for ipam_config
Optional:
aux_address(Map of String) Auxiliary IPv4 or IPv6 addresses used by Network drivergateway(String) The IP address of the gatewayip_range(String) The ip range in CIDR formsubnet(String) The subnet in CIDR form
Nested Schema for labels
Required:
label(String) Name of the labelvalue(String) Value of the label
Import
Import is supported using the following syntax by providing the id:
#!/bin/bash
terraform import docker_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
resource "docker_network" "foo" {
name = "foo"
}
then the import command is as follows
#!/bin/bash
terraform import docker_network.foo 87b57a9b91ecab2db2a6dbf38df74c67d7c7108cbe479d6576574ec2cd8c2d73