dokploy_security (Resource)
HTTP basic-auth credentials that protect a Dokploy application.
~> Dokploy stores and returns password in cleartext. The attribute is sensitive, so Terraform does not print it, but anyone with API access to the server can read it, and the Terraform state holds it in cleartext like any other attribute. The password_wo companion keeps it out of the state.
Example Usage
# 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
Required
application_id(String) Id of the application that owns this record. A change forces a replacement: the Dokploy update endpoint for this record type has no parent field, so a record cannot move between applications.username(String) Basic-auth username.
Optional
NOTE: Write-only arguments are supported in Terraform 1.11 and later.
password(String, Sensitive) Basic-auth password. Set this attribute orpassword_wo.password_wo(String, Sensitive, Write-only) Write-only form ofpassword. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Set exactly one ofpasswordandpassword_wo. A new value reaches the server only whenpassword_wo_versionchanges.password_wo_version(Number) Version ofpassword_wo. Change it to send the currentpassword_wovalue to the server. It needspassword_wo.
Read-Only
id(String) Record id.
Import
Import is supported using the following syntax:
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
import {
to = dokploy_security.staging_gate
id = "s1a2b3c4d5e6f7g8h9i0j"
}The terraform import command can be used, for example:
terraform import dokploy_security.staging_gate s1a2b3c4d5e6f7g8h9i0j