> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/tools-terraform/docs/resources/ipblock.md).

# ionoscloud\_ipblock

Creates and manages IP Block objects.

Manages **IP Blocks** on IONOS CLOUD. IP Blocks contain reserved public IP addresses that can be assigned servers or other resources.

## Example Usage

```hcl
resource "ionoscloud_ipblock" "example" {
  location  = "us/las"
  size      = 1
  name      = "IP Block Example"
}
```

## Argument reference

* `name` - (Optional)\[string] The name of Ip Block
* `location` - (Required)\[string] The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.
* `size` - (Required)\[integer] The number of IP addresses to reserve for this block.
* `ips` - (Computed)\[integer] The list of IP addresses associated with this block.
* `ip_consumers` (Computed) Read-Only attribute. Lists consumption detail of an individual ip
  * `ip`
  * `mac`
  * `nic_uuid`
  * `server_id`
  * `server_name`
  * `datacenter_id`
  * `datacenter_name`
  * `k8s_nodepool_uuid`
  * `k8s_cluster_uuid`

> **Note:** `terraform plan -generate-config-out` writes one empty `ip_consumers {}` block per entry of this computed attribute. The blocks plan as a no-op and can be removed from the generated configuration.

## Import

Resource Ipblock can be imported using the `resource id`, e.g.

```shell
terraform import ionoscloud_ipblock.myipblock ipblock_uuid
```

In Terraform v1.12.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can also be used with the `identity` attribute:

```hcl
import {
  to = ionoscloud_ipblock.example
  identity = {
    id = "ipblock uuid"
  }
}

resource "ionoscloud_ipblock" "example" {
  ### Configuration omitted for brevity ###
}
```

### Identity Schema

#### Required

* `id` (String) The UUID of the IP Block.

#### Optional

* `location` (String) The regional location of the IP Block (e.g. `de/fra`). Only needed when the Cloud API endpoint is overridden per location.

## Query (List Resource)

IP Blocks can be listed using `terraform query` (requires Terraform 1.14+). List blocks must be placed in a dedicated query file, whose name ends in `.tfquery.hcl` (for example `queries.tfquery.hcl`).

```hcl
list "ionoscloud_ipblock" "all" {
  provider         = ionoscloud
  include_resource = true
}
```

See the [`ionoscloud_ipblock` list resource documentation](https://docs.ionos.com/cloud/tools-terraform/docs/list-resources/ipblock.md) for filters and the full attribute reference.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/tools-terraform/docs/resources/ipblock.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
