# 

# exoscale_private_network (Resource)

Manage Exoscale [Private Networks](https://community.exoscale.com/product/networking/private-network/).

Corresponding data source: [exoscale_private_network]({{< ref "../data-sources/private_network.md" >}}).

## Example Usage

*Unmanaged* private network:

```terraform
resource "exoscale_private_network" "my_private_network" {
  zone = "ch-gva-2"
  name = "my-private-network"
}
```

*Managed* private network:

```terraform
resource "exoscale_private_network" "my_managed_private_network" {
  zone = "ch-gva-2"
  name = "my-managed-private-network"

  netmask  = "255.255.255.0"
  start_ip = "10.0.0.20"
  end_ip   = "10.0.0.253"
}
```

Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The private network name.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `description` (String) A free-form text describing the network.
- `end_ip` (String) (For managed Privnets) The first/last IPv4 addresses used by the DHCP service for dynamic leases.
- `labels` (Map of String) A map of key/value labels.
- `netmask` (String) (For managed Privnets) The network mask defining the IPv4 network allowed for static leases.
- `start_ip` (String) (For managed Privnets) The first/last IPv4 addresses used by the DHCP service for dynamic leases.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `delete` (String)
- `read` (String)
- `update` (String)

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.

## Import

An existing private network may be imported by `<ID>@<zone>`:

```shell
terraform import \
  exoscale_private_network.my_private_network \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

