# dokploy_security (Data Source)

Looks up a basic-auth record of an application that already exists in Dokploy:

```terraform
data "dokploy_security" "admin" {
  application_id = data.dokploy_application.web.id
  username       = "admin"
}
```

~> **The data source does not expose the password.** `password` exists on the `dokploy_security` resource, but not here, by design.

~> Dokploy does not enforce uniqueness for this record. If two security records match the lookup attributes, this data source fails instead of a guess. Look the record up by `id` in that case.

## Example Usage

```terraform
data "dokploy_security" "example" {
  id = "your-security-id"
}

data "dokploy_security" "admin" {
  application_id = data.dokploy_application.web.id
  username       = "admin"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `application_id` (String) Id of the application that owns the record. Set it with `username`.
- `id` (String) Security id. Set it for a lookup by id, or leave it unset and set `application_id` with the distinguishing attributes.
- `username` (String) Basic-auth user name.