> 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/terraform/data-sources/inmemorydb_cluster_v2.md).

# ionoscloud\_inmemorydb\_cluster\_v2

The `ionoscloud_inmemorydb_cluster_v2` data source can be used to retrieve information about an existing InMemoryDB V2 cluster.

## Example Usage

### By id

```hcl
data "ionoscloud_inmemorydb_cluster_v2" "by_id" {
  id       = "example-id"
  location = "de/txl"
}
```

### By name

```hcl
data "ionoscloud_inmemorydb_cluster_v2" "by_name" {
  name     = "my-inmemorydb-cluster"
  location = "de/txl"
}
```

## Argument Reference

* `id` - (Optional) The UUID of the cluster.
* `name` - (Optional) The cluster name (exact match).
* `location` - (Required)\[string] The location of the cluster.

> **Note:** Either `id` or `name` must be provided. If none, or both are provided, the datasource will return an error.

## Attributes Reference

The following attributes are returned by the datasource:

* `id` - The UUID of the cluster.
* `name` - The name of the cluster.
* `location` - The location of the cluster.
* `description` - Human-readable description for the cluster.
* `version` - The InMemoryDB version.
* `persistence_mode` - The data persistence mode.
* `eviction_policy` - The key eviction strategy.
* `logs_enabled` - Whether log collection is enabled.
* `metrics_enabled` - Whether metrics collection is enabled.
* `dns_name` - The DNS name for connecting to the cluster's primary instance.
* `instances` - Instance sizing configuration:
  * `count` - Number of instances.
  * `cores` - CPU cores per instance.
  * `ram` - RAM per instance in GB.
* `connections` - Network connection configuration:
  * `datacenter_id` - The Virtual Data Center ID.
  * `lan_id` - The numeric LAN ID.
  * `primary_instance_address` - The primary instance IP in CIDR notation.
* `snapshot` - Snapshot configuration:
  * `location` - Object Storage location for snapshots.
  * `retention_days` - Days snapshots are retained.
  * `snapshot_hours` - UTC hours at which snapshots are taken.
* `maintenance_window` - Maintenance window configuration:
  * `time` - Maintenance window start time in UTC (HH:MM:SS).
  * `day_of_the_week` - Maintenance window day of the week.
* `credentials` - Credentials block:
  * `username` - The username for the InMemoryDB user.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.ionos.com/cloud/terraform/data-sources/inmemorydb_cluster_v2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
