> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# coreweave_networking_vpc (Resource)

> Terraform resource for creating and managing CoreWeave VPCs with host prefixes and IPAM configuration

Create and manage VPCs. Learn more about [CoreWeave VPCs](/products/networking/vpc/about-vpcs).

## Example usage

```terraform theme={"system"}
resource "coreweave_networking_vpc" "example" {
  name = "default"
  zone = "US-EAST-04A"

  host_prefixes = [
    {
      name = "primary"
      type = "PRIMARY"
      prefixes = [
        "10.16.192.0/18",
        "2601:db8:aaaa::/48",
      ]
    },
    {
      name = "container-network"
      type = "ROUTED"
      prefixes = [
        "2601:db8:bbbb::/48"
      ]
      ipam = {
        prefix_length          = 80
        gateway_address_policy = "FIRST_IP" # Other options available, see docs for details
      }
    },
    {
      name = "attached-network"
      type = "ATTACHED"
      prefixes = [
        "2601:db8:cccc::/48"
      ]
      ipam = {
        prefix_length = 64
      }
    },
  ]

  vpc_prefixes = [
    {
      name  = "pod cidr"
      value = "10.0.0.0/13"
    },
    {
      name  = "service cidr"
      value = "10.16.0.0/22"
    },
    {
      name  = "internal lb cidr"
      value = "10.32.4.0/22"
    },
  ]

  egress = {
    disable_public_access = false
  }

  ingress = {
    disable_public_services = false
  }

  dhcp = {
    dns = {
      servers = ["1.1.1.1", "8.8.8.8"]
    }
  }
}
```

## Schema

### Required

* `name` (String) The name of the VPC. Must not be longer than 30 characters.
* `zone` (String) The Availability Zone in which the VPC is located.

### Optional

* `dhcp` (Attributes) Settings affecting DHCP behavior within the VPC. (see [below for nested schema](#nestedatt--dhcp))
* `egress` (Attributes) Settings affecting traffic leaving the VPC. (see [below for nested schema](#nestedatt--egress))
* `host_prefix` (String, Deprecated) An IPv4 CIDR range used to allocate host addresses when booting compute into a VPC.
  This CIDR must be have a mask size of /18. If left unspecified, a Zone-specific default value will be applied by the server.
  This field is immutable once set.
* `host_prefixes` (Attributes Set) The IPv4 or IPv6 CIDR ranges used to allocate host addresses when booting compute into a VPC. (see [below for nested schema](#nestedatt--host_prefixes))
* `ingress` (Attributes) Settings affecting traffic entering the VPC. (see [below for nested schema](#nestedatt--ingress))
* `vpc_prefixes` (Attributes Set) A list of additional prefixes associated with the VPC. For example, CKS clusters use these prefixes for Pod and service CIDR ranges. (see [below for nested schema](#nestedatt--vpc_prefixes))

### Read-Only

* `id` (String) The unique identifier for the VPC.

### Nested Schema for `dhcp`

Optional:

* `dns` (Attributes) Settings affecting DNS for DHCP within the VPC (see [below for nested schema](#nestedatt--dhcp--dns))

### Nested Schema for `dhcp.dns`

Optional:

* `servers` (Set of String) The DNS servers to be used by DHCP clients within the VPC.

### Nested Schema for `egress`

Optional:

* `disable_public_access` (Boolean) Specifies whether the VPC should be blocked from consuming public Internet.

### Nested Schema for `host_prefixes`

Required:

* `name` (String) The user-specified name of the host prefix.
* `prefixes` (List of String) The VPC-wide aggregates from which host-specific prefixes are allocated. May be IPv4 or IPv6.
* `type` (String) Controls network connectivity from the prefix to the host. Must be one of: `PRIMARY`, `ROUTED`, `ATTACHED`.

Optional:

* `ipam` (Attributes) The configuration for a secondary host prefix. (see [below for nested schema](#nestedatt--host_prefixes--ipam))

### Nested Schema for `host_prefixes.ipam`

Required:

* `prefix_length` (Number) The desired length for each Node's allocation from the VPC-wide aggregate prefix.

Optional:

* `gateway_address_policy` (String) Describes which IP address from the prefix is allocated to the network gateway. Must be one of: `UNSPECIFIED`, `EUI64`, `FIRST_IP`, `LAST_IP`.

### Nested Schema for `ingress`

Optional:

* `disable_public_services` (Boolean) Specifies whether the VPC should prevent public prefixes advertised from Nodes from being imported into public-facing networks, making them inaccessible from the Internet.

### Nested Schema for `vpc_prefixes`

Required:

* `name` (String)
* `value` (String)

## Import

Import is supported using the following syntax:

```bash theme={"system"}
terraform import coreweave_networking_vpc.default {{id}}
```
