# ionoscloud\_private\_crossconnect

Manages a [Cross Connect](https://docs.ionos.com/cloud/network-services/cross-connect/overview) on IONOS CLOUD. Cross Connect allows you to connect virtual data centers (VDC) with each other using a private LAN. The VDCs to be connected need to belong to the same IONOS CLOUD contract and location. You can only use private LANs for a Cross Connect connection. A LAN can only be a part of one Cross Connect.

The IP addresses of the NICs used for the Cross Connect connection may not be used in more than one NIC and they need to belong to the same IP range.

## Example Usage

To connect two datacenters we need 2 lans defined, one in each datacenter. After, we reference the cross-connect through which we want the connection to be established.

```hcl
resource ionoscloud_private_crossconnect CrossConnectTestResource {
  name        = "CrossConnectTestResource"
  description = "CrossConnectTestResource"
}

resource ionoscloud_datacenter dc1 {
  location = "de/txl"
  name = "dc1"
}

resource ionoscloud_datacenter dc2 {
  location = "de/txl"
  name = "dc2"
}

resource ionoscloud_lan dc1lan {
  datacenter_id = ionoscloud_datacenter.dc1.id
  public = false
  name = "dc1lan"
  pcc = ionoscloud_private_crossconnect.CrossConnectTestResource.id
}

resource ionoscloud_lan dc2lan {
  datacenter_id = ionoscloud_datacenter.dc2.id
  public = false
  name = "dc2lan"
  pcc = ionoscloud_private_crossconnect.CrossConnectTestResource.id
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required)\[string] The name of the cross-connection.
* `description` - (Optional)\[string] A short description for the cross-connection.
* `connectable datacenters` - (Computed) A list containing all the connectable datacenters
  * `id` - The UUID of the connectable datacenter
  * `name` - The name of the connectable datacenter
  * `location` - The physical location of the connectable datacenter
* `peers` - (Computed) Lists LAN's joined to this cross connect
  * `lan_id` - The id of the cross-connected LAN
  * `lan_name` - The name of the cross-connected LAN
  * `datacenter_id` - The id of the cross-connected datacenter
  * `datacenter_name` - The name of the cross-connected datacenter
  * `location` - The location of the cross-connected datacenter

## Import

A Cross Connect resource can be imported using its `resource id`, e.g.

```shell
terraform import ionoscloud_private_crossconnect.demo ionoscloud_private_crossconnect_uuid
```

This can be helpful when you want to import cross-connects which you have already created manually or using other means, outside of terraform.


---

# 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/resources/private_crossconnect.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.
