# dokploy_security (Resource)

HTTP basic-auth credentials protecting a Dokploy application.

~> Dokploy stores and returns `password` in cleartext. The attribute is marked sensitive so Terraform will not print it, but it is readable by anyone with API access to the instance, and it is written to Terraform state in cleartext like any other attribute.

## Example Usage

```terraform
# Basic-auth in front of a staging application.
resource "dokploy_security" "staging_gate" {
  application_id = dokploy_application.staging.id
  username       = "preview"
  password       = var.staging_password
}
```

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

### Required

- `application_id` (String) Id of the application this belongs to. Changing it forces replacement: Dokploy's update endpoint for this record type takes no parent field, so a record cannot be moved between applications.
- `password` (String, Sensitive) Basic-auth password.
- `username` (String) Basic-auth username.

### Read-Only

- `id` (String) Record id.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import dokploy_security.staging_gate s1a2b3c4d5e6f7g8h9i0j
```