# ionoscloud\_resource

The **Resource data source** can be used to search for and return any existing IONOS CLOUD resource and optionally their group associations. You can provide a string for the resource type (datacenter,image,snapshot,ipblock) and/or resource id parameters which will be queries against available resources. 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_resource" "example" {
  resource_id   = "resource_id"
}
```

### By Type

```hcl
data "ionoscloud_resource" "example" {
  resource_type = "datacenter"
}
```

### By ID & Type

```hcl
data "ionoscloud_resource" "example" {
  resource_type = "datacenter"
  resource_id   = "resource_id"
}
```

## Argument Reference

* `resource_type` - (Optional) The specific type of resources to retrieve information about.
* `resource_id` - (Optional) The ID of the specific resource to retrieve information about.

## Attributes Reference

* `id` - UUID of the Resource


---

# 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/resource.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.
