Skip to content

feat: add dbtcloud_job_completion_trigger resource #663

@trouze

Description

@trouze

Summary

Add a new dbtcloud_job_completion_trigger resource that manages job-chaining trigger conditions separately from the dbtcloud_job resource.

Motivation

The existing approach of configuring job completion triggers inside dbtcloud_job creates circular dependency problems when chaining jobs (Job A triggers Job B, Job B triggers Job C, etc.). A standalone resource breaks the cycle by letting each trigger be declared independently.

Resource schema

resource "dbtcloud_job_completion_trigger" "example" {
  job_id         = dbtcloud_job.downstream.id   # downstream job
  trigger_job_id = dbtcloud_job.upstream.id     # upstream job
  project_id     = dbtcloud_project.example.id
  statuses       = ["success", "error"]         # also supports "canceled"
  
  # Optional migration metadata
  resource_metadata = {}
}

Attributes

Attribute Type Description
job_id int64 The downstream job to trigger
trigger_job_id int64 The upstream job that fires the trigger
project_id int64 Project where the upstream job lives
statuses set(string) Conditions: success, error, canceled
resource_metadata dynamic Optional migration identity metadata

Files

  • pkg/framework/objects/job_completion_trigger/model.go
  • pkg/framework/objects/job_completion_trigger/resource.go
  • pkg/framework/objects/job_completion_trigger/schema.go

Source

Developed on branch fix/provider-bug-wsargent as part of account migration tooling work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions