# ionoscloud\_lan

The **LAN data source** can be used to search for and return existing lans. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.

## Example Usage

### By ID

```hcl
data "ionoscloud_lan" "example" {
  datacenter_id = "datacenter_id"
  id			= "lan_id"
}
```

### By Name

```hcl
data "ionoscloud_lan" "example" {
  datacenter_id = "datacenter_id"
  name			= "Lan Example"
}
```

## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing lan that you want to search for.
* `id` - (Optional) ID of the lan you want to search for.

`datacenter_id` and either `name` or `id` must be provided. If none, or both of `name` and `id` are provided, the datasource will return an error.

## Attributes Reference

The following attributes are returned by the datasource:

* `id` - The id of the LAN.
* `name` - The name of the LAN.
* `datacenter_id` - The ID of lan's Virtual Data Center.
* `ip_failover` - list of
  * `nic_uuid`
  * `ip`
* `pcc` - The unique id of a `ionoscloud_private_crossconnect` resource, in order.
* `public` - Indicates if the LAN faces the public Internet (true) or not (false).
* `ipv4_cidr_block` - For public LANs this property is null, for private LANs it contains the private IPv4 CIDR range.
* `ipv6_cidr_block` - Contains the LAN's /64 IPv6 CIDR block if this LAN is IPv6 enabled.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/terraform-provider/data-sources/lan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
