Ignitify.dev
ignitify_schedule
Terraform

ignitify_schedule

A recurring schedule of a task. At each slot of a cron expression, the platform starts a run of the task's newest ready deployment, with the payload and run settings given here. A code update keeps the schedule. Needs schedules.read and schedules.write (tasks.read to import), and a plan with room for one more schedule. The resource works from provider 0.4.0. To grant schedules.read and schedules.write with ignitify_group, use provider 0.5.0 or later.

Example

app.tf
# Every night at 03:00 Berlin time. The task comes from the deployment, so the
# schedule is created after the first build is ready.
resource "ignitify_schedule" "nightly" {
  task     = ignitify_deployment.report.task
  cron     = "0 3 * * *"
  timezone = "Europe/Berlin"

  # Stored in the state in plain text: never put a secret here.
  payload = jsonencode({ day = "yesterday" })

  timeout_sec = 600
  overlap     = "skip"
}

Arguments and attributes

NameTypeUseMeaning
taskStringRequiredforces replacementThe slug of the task.
cronStringRequiredA 5-field cron expression, or a nickname such as @daily. The server checks it at apply.
payloadStringRequiredThe run payload as JSON (use jsonencode). Stored in the state in plain text: never a secret. Empty after an import, so the first apply sends it.
timezoneStringOptionalThe IANA time zone of the expression. Default UTC. Write the canonical name, for example Europe/Berlin.
overlapStringOptionalWhat a slot does while the previous run is live: skip (default) or allow.
pausedBooleanOptionalWhether the schedule is paused. Default false.
presetStringOptionalThe run preset. Unset: the deployment's at each slot.
timeout_secNumberOptionalThe run timeout in seconds. Unset: the deployment's at each slot.
deadline_secNumberOptionalA hard limit on the run's total time, in seconds. At least the timeout. Unset: no deadline.
executionStringOptionalThe run's execution settings as JSON. Unset: the deployment's at each slot.
statusStringRead-onlyactive, paused or auto_paused (paused by the platform; see pause_reason).
pause_reasonStringRead-onlyWhy the platform paused the schedule: consecutive-misses, plan-limit or invalid-schedule; null unless status is auto_paused.
pause_detailStringRead-onlyFor plan-limit, the plan field that refused (max_schedules: the plan does not include recurring schedules); for invalid-schedule, why the expression cannot fire; otherwise null. Provider v0.4.1 or newer.
payload_sha256StringRead-onlyThe server's digest of the stored payload. It changes only when the payload changes.
schedule_idStringRead-onlyThe server id (sch_…). The import id is <task slug>/<schedule_id>.
created_byStringRead-onlyThe id of the API key that created the schedule.
created_atStringRead-onlyWhen the schedule was created (ISO 8601).

Behaviour

  • Each slot runs the task's newest ready deployment, so a code update needs no change here.
  • A change made outside Terraform shows in the next plan: a pause, a new payload, another zone or expression. The apply puts the configured values back.
  • The platform pauses a schedule after too many missed slots in a row, or when the plan no longer allows what it runs. Then status is auto_paused and every plan warns. Terraform does not resume it on its own: fix the cause, then resume it with ignitify schedule:resume. If the plan does not include recurring schedules (pause_detail is max_schedules), the resume is refused: change plan first.
  • When the monthly compute of the plan is spent, slots are missed until the allowance resets. These misses do not pause the schedule.
  • A resumed schedule fires from its next slot. It does not catch up the slots it missed.
  • Deleting the task deletes its schedules.
  • The plan limits how many schedules a tenant holds. One more is refused at apply with schedule-quota. The Free plan does not include schedules: a create there is refused with capability-denied, and so is a resume or an apply that sets paused = false. Change plan first.

Import

The import id is <task slug>/<schedule_id>. After an import, payload is empty, so the first apply sends the configured payload.

terminal
$ terraform import ignitify_schedule.nightly report/<schedule_id>