> For the complete documentation index, see [llms.txt](https://docs.ionos.com/terraform-provider/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/terraform-provider/data-sources/kafka_user_credentials.md).

# 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;
