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

# ionoscloud\_mariadb\_cluster\_v2

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

## Example Usage

### By id

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

### By name

```hcl
data "ionoscloud_mariadb_cluster_v2" "by_name" {
  name     = "my-mariadb-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 to query. Available locations: `de/fra`, `de/txl`, `es/vit`, `fr/par`, `gb/bhx`, `gb/lhr`, `us/ewr`, `us/las`, `us/mci`.

> **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 MariaDB version for the cluster.
* `logs_enabled` - Whether log collection and reporting is enabled for this cluster's observability.
* `metrics_enabled` - Whether metrics collection and reporting is enabled for this cluster's observability.
* `dns_name` - The DNS name used to access the cluster.
* `instances` - Compute and storage configuration:
  * `count` - The total number of instances in the cluster.
  * `cores` - The number of CPU cores per instance.
  * `ram` - The amount of memory per instance in gigabytes (GB).
  * `storage_size` - The amount of storage per instance in gigabytes (GB).
* `connections` - Connection information of the MariaDB cluster:
  * `datacenter_id` - The ID of the Virtual Data Center the cluster is connected to.
  * `lan_id` - The numeric LAN ID the cluster is connected to.
  * `primary_instance_address` - The IP address and netmask of the cluster's primary instance, in CIDR notation.
* `backup` - Backup location and retention configuration:
  * `location` - The Object Storage location where the backup is stored.
  * `retention_days` - The number of days cluster backups are retained.
* `maintenance_window` - Maintenance window configuration:
  * `time` - Start of the maintenance window in UTC time.
  * `day_of_the_week` - The name of the week day.
* `credentials` - Credentials block:
  * `username` - The username of the initial MariaDB user.
  * `database` - The name of the initial database.

> **Note:** `credentials.password` is not available — the API never returns the password.


---

# 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/tools-terraform/data-sources/mariadb_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.
