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

dokploy_schedule (Data Source)

Looks up a scheduled job of an application, a compose service or a server that already exists in Dokploy:

terraform
data "dokploy_schedule" "cleanup" {
  service_id    = data.dokploy_application.web.id
  schedule_type = "application"
  name          = "cleanup"
}

A schedule of type dokploy-server has no parent. Look it up by id.

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

data "dokploy_schedule" "cleanup" {
  service_id    = data.dokploy_application.web.id
  schedule_type = "application"
  name          = "cleanup"
}

Schema

Optional

  • id (String) Schedule id. Set it for a lookup by id, or leave it unset and set service_id with the distinguishing attributes.
  • name (String) Display name of the schedule.
  • schedule_type (String) Type of the parent: application, compose, server or dokploy-server.
  • service_id (String) Id of the application, compose service or server that owns the schedule. Set it with schedule_type and name.

Read-Only

  • app_name (String) Internal name of the schedule.
  • command (String) Command that the job runs.
  • created_at (String) Creation timestamp from the server.
  • cron_expression (String) Cron expression of the schedule.
  • description (String) Description of the job, or null.
  • enabled (Boolean) Whether the job runs.
  • script (String) Script of the job, or null.
  • service_name (String) Compose service name, or null.
  • shell_type (String) Shell that runs the command: bash or sh.
  • timezone (String) Time zone of the cron expression, or null.