# ionoscloud\_kafka\_user\_credentials

The **Kafka user credentials** data source can be used to retrieve access credentials for a specific user.

> ⚠️ In order to avoid storing sensitive data in the state, the user credentials [ephemeral resource](/terraform-provider/ephemerals/kafka_user_credentials.md) can be used.

## Example Usage

### By ID

```hcl
data "ionoscloud_kafka_user_credentials" "kafka_user_credentials_ds" {
  cluster_id = "kafka_cluster_id"
  id = "kafka_user_id"
  location = "kafka_cluster_location"
  timeouts = {
    read = "1m"
  }
}
```

### By name

```hcl
data "ionoscloud_kafka_user_credentials" "kafka_user_credentials_ds" {
  cluster_id = "kafka_cluster_id"
  username = "kafka_username"
  location = "kafka_cluster_location"
  timeouts = {
    read = "1m"
  }
}
```

## Argument reference

* `cluster_id` - (Required)\[string] the ID of the Kafka cluster;
* `id` - (Optional)\[string] the ID of the Kafka user, can be retrieved using [`ionoscloud_kafka_users` data source](/terraform-provider/data-sources/kafka_users.md);
* `username` - (Optional)\[string] the name of the Kafka user, can be retrieved using [`ionoscloud_kafka_users` data source](/terraform-provider/data-sources/kafka_users.md);
* `location` - (Optional)\[string] the location of the Kafka cluster, can be one of: `de/fra`, `de/fra/2`, `de/txl`, `fr/par`, `es/vit`, `gb/lhr`, `gb/bhx`, `us/las`, `us/mci`, `us/ewr`. If omitted, the default location will be used: `de/fra`;

## Attributes reference

The following attributes are returned by the data source:

* `id` - the ID of the user;
* `username` - the name of the user;
* `certificate_authority` - PEM for the certificate authority;
* `private_key` - PEM for the private key;
* `certificate` - PEM for the certificate;


---

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