# 

# exoscale_vpc_subnet (Data Source)

Fetch Exoscale [VPC](https://community.exoscale.ch/product/networking/vpc/) Subnet data.

Corresponding resource: [exoscale_vpc_subnet]({{< ref "../resources/vpc_subnet.md" >}}).

## Example Usage

```terraform
data "exoscale_vpc_subnet" "my_vpc_subnet" {
  zone   = "ch-gva-2"
  vpc_id = "9ecc6b8b-73d4-4211-8ced-f7f29bb79524"
  name   = "my-vpc-subnet"
}

output "my_vpc_subnet_id" {
  value = data.exoscale_vpc_subnet.my_vpc_subnet.id
}
```

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

- `vpc_id` (String) The parent [exoscale_vpc]({{< ref "./vpc.md" >}}) ID.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The Subnet ID to match (conflicts with `name`).
- `name` (String) The Subnet name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `address_family` (String) The Subnet address family.
- `address_space` (String) The Subnet address space.
- `description` (String) The Subnet description.
- `ipv4_block` (String) The Subnet IPv4 CIDR.
- `labels` (Map of String) A map of key/value labels.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

