skip to content
wihan.dev
view as markdown
browse the dokploy docs

dokploy_redirect (Data Source)

Looks up a Traefik regex redirect of an application that already exists in Dokploy:

terraform
data "dokploy_redirect" "old" {
  application_id = data.dokploy_application.web.id
  regex          = "^/old/(.*)"
}

~> Dokploy does not enforce uniqueness for this record. If two redirect 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_redirect" "example" {
  id = "your-redirect-id"
}

data "dokploy_redirect" "old" {
  application_id = data.dokploy_application.web.id
  regex          = "^/old/(.*)"
}

Schema

Optional

  • application_id (String) Id of the application that owns the redirect. Set it with regex.
  • id (String) Redirect id. Set it for a lookup by id, or leave it unset and set application_id with the distinguishing attributes.
  • regex (String) Path regex that the redirect matches, for example ^/old/(.*).

Read-Only

  • permanent (Boolean) Whether the redirect is permanent (308) instead of temporary (307).
  • replacement (String) Replacement path.