dokploy_redirect (Resource)
A Traefik regex redirect on a Dokploy application.
~> Redirects are not unique. Dokploy allows two identical redirects on one application, and redirects.create does not return the record it made, so this provider identifies a newly created redirect by diffing the application’s redirect list around the call. Creating redirects through the Dokploy UI while an apply is running can make that ambiguous, and the provider errors rather than guessing.
Example Usage
resource "dokploy_redirect" "legacy_blog" {
application_id = dokploy_application.web.id
regex = "^/blog/(.*)"
replacement = "/posts/$1"
permanent = true
}
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.regex(String) Path regex to match, e.g.^/old/(.*).replacement(String) Replacement path, e.g./new/$1.
Optional
permanent(Boolean) Issue a permanent (308) redirect rather than a temporary (307) one.
Read-Only
id(String) Record id.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
terraform import dokploy_redirect.legacy_blog r1a2b3c4d5e6f7g8h9i0j