In October 2023, CI improvements have been rolled out to dbt Cloud with minor impacts to some jobs: more info.
Those improvements include modifications to deferral which was historically set at the job level and will now be set at the environment level. Deferral can still be set to “self” by settingself_deferringtotruebut with the new approach, deferral to other runs need to be done withdeferring_environment_idinstead ofdeferring_job_id.
New with 0.3.1,
triggersnow accepts aon_mergevalue to trigger jobs when code is merged in git. Ifon_mergeistrueall other triggers need to befalse.
For now, it is not a mandatory field, but it will be in a future version. Please addon_mergein your config or modules.
For Continuous Integration
In the case of Continuous Integration, our CI job needs to defer to the Production environment. So, we need to have a successful run in the Production environment before the CI process can execute as expected.
The example below shows how the Terraform config can be updated to automatically trigger a run of the job in the Production environment, leveraging the local-exec provisioner and curl to trigger the run.
import * as pulumi from "@pulumi/pulumi";
import * as command from "@pulumi/command";
import * as dbtcloud from "@pulumi/dbtcloud";
// a periodic job, but we trigger it once with `dbt parse` as soon as it is created so we can defer to the environment it is in
// to do so, we use a local-exec provisioner, just make sure that the machine running Terraform has curl installed
const dailyJob = new dbtcloud.Job("daily_job", {
environmentId: prodEnvironment.environmentId,
executeSteps: ["dbt build"],
generateDocs: true,
name: "Daily job",
numThreads: 64,
projectId: dbtProject.id,
runGenerateSources: true,
targetName: "default",
triggers: {
github_webhook: false,
git_provider_webhook: false,
schedule: true,
on_merge: false,
},
scheduleDays: [
0,
1,
2,
3,
4,
5,
6,
],
scheduleType: "days_of_week",
scheduleHours: [0],
});
const dailyJobProvisioner0 = new command.local.Command("dailyJobProvisioner0", {create: `response=$(curl -s -L -o /dev/null -w \"%{http_code}\" -X POST \\
-H 'Authorization: Bearer ${dbtToken}' \\
-H 'Content-Type: application/json' \\
-d '{\"cause\": \"Generate manifest\", \"steps_override\": [\"dbt parse\"]}' \\
${dbtHostUrl}/v2/accounts/${dbtAccountId}/jobs/${id}/run/)
if [ \"$response\" -ge 200 ] && [ \"$response\" -lt 300 ]; then
echo \"Success: HTTP status $response\"
exit 0
else
echo \"Failure: HTTP status $response\"
exit 1
fi
`}, {
dependsOn: [dailyJob],
});
import pulumi
import pulumi_command as command
import pulumi_dbtcloud as dbtcloud
# a periodic job, but we trigger it once with `dbt parse` as soon as it is created so we can defer to the environment it is in
# to do so, we use a local-exec provisioner, just make sure that the machine running Terraform has curl installed
daily_job = dbtcloud.Job("daily_job",
environment_id=prod_environment["environmentId"],
execute_steps=["dbt build"],
generate_docs=True,
name="Daily job",
num_threads=64,
project_id=dbt_project["id"],
run_generate_sources=True,
target_name="default",
triggers={
"github_webhook": False,
"git_provider_webhook": False,
"schedule": True,
"on_merge": False,
},
schedule_days=[
0,
1,
2,
3,
4,
5,
6,
],
schedule_type="days_of_week",
schedule_hours=[0])
daily_job_provisioner0 = command.local.Command("dailyJobProvisioner0", create=fresponse=$(curl -s -L -o /dev/null -w \"%{{http_code}}\" -X POST \\
-H 'Authorization: Bearer {dbt_token}' \\
-H 'Content-Type: application/json' \\
-d '{{\"cause\": \"Generate manifest\", \"steps_override\": [\"dbt parse\"]}}' \\
{dbt_host_url}/v2/accounts/{dbt_account_id}/jobs/{id}/run/)
if [ \"$response\" -ge 200 ] && [ \"$response\" -lt 300 ]; then
echo \"Success: HTTP status $response\"
exit 0
else
echo \"Failure: HTTP status $response\"
exit 1
fi
,
opts = pulumi.ResourceOptions(depends_on=[daily_job]))
package main
import (
"fmt"
"github.com/pulumi/pulumi-command/sdk/go/command/local"
"github.com/pulumi/pulumi-dbtcloud/sdk/go/dbtcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// a periodic job, but we trigger it once with `dbt parse` as soon as it is created so we can defer to the environment it is in
// to do so, we use a local-exec provisioner, just make sure that the machine running Terraform has curl installed
dailyJob, err := dbtcloud.NewJob(ctx, "daily_job", &dbtcloud.JobArgs{
EnvironmentId: pulumi.Any(prodEnvironment.EnvironmentId),
ExecuteSteps: pulumi.StringArray{
pulumi.String("dbt build"),
},
GenerateDocs: pulumi.Bool(true),
Name: pulumi.String("Daily job"),
NumThreads: pulumi.Int(64),
ProjectId: pulumi.Any(dbtProject.Id),
RunGenerateSources: pulumi.Bool(true),
TargetName: pulumi.String("default"),
Triggers: &dbtcloud.JobTriggersArgs{
Github_webhook: false,
Git_provider_webhook: false,
Schedule: pulumi.Bool(true),
On_merge: false,
},
ScheduleDays: pulumi.IntArray{
pulumi.Int(0),
pulumi.Int(1),
pulumi.Int(2),
pulumi.Int(3),
pulumi.Int(4),
pulumi.Int(5),
pulumi.Int(6),
},
ScheduleType: pulumi.String("days_of_week"),
ScheduleHours: pulumi.IntArray{
pulumi.Int(0),
},
})
if err != nil {
return err
}
_, err = local.NewCommand(ctx, "dailyJobProvisioner0", &local.CommandArgs{
Create: fmt.Sprintf(`%v%v' \\
-H 'Content-Type: application/json' \\
-d '{\"cause\": \"Generate manifest\", \"steps_override\": [\"dbt parse\"]}' \\
%v/v2/accounts/%v/jobs/%v/run/)
if [ \"$response\" -ge 200 ] && [ \"$response\" -lt 300 ]; then
echo \"Success: HTTP status $response\"
exit 0
else
echo \"Failure: HTTP status $response\"
exit 1
fi
`, "response=$(curl -s -L -o /dev/null -w \\\"%{http_code}\\\" -X POST \\\\\n -H 'Authorization: Bearer ", dbtToken, dbtHostUrl, dbtAccountId, id),
}, pulumi.DependsOn([]pulumi.Resource{
dailyJob,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Command = Pulumi.Command;
using DbtCloud = Pulumi.DbtCloud;
return await Deployment.RunAsync(() =>
{
// a periodic job, but we trigger it once with `dbt parse` as soon as it is created so we can defer to the environment it is in
// to do so, we use a local-exec provisioner, just make sure that the machine running Terraform has curl installed
var dailyJob = new DbtCloud.Job("daily_job", new()
{
EnvironmentId = prodEnvironment.EnvironmentId,
ExecuteSteps = new[]
{
"dbt build",
},
GenerateDocs = true,
Name = "Daily job",
NumThreads = 64,
ProjectId = dbtProject.Id,
RunGenerateSources = true,
TargetName = "default",
Triggers = new DbtCloud.Inputs.JobTriggersArgs
{
Github_webhook = false,
Git_provider_webhook = false,
Schedule = true,
On_merge = false,
},
ScheduleDays = new[]
{
0,
1,
2,
3,
4,
5,
6,
},
ScheduleType = "days_of_week",
ScheduleHours = new[]
{
0,
},
});
var dailyJobProvisioner0 = new Command.Local.Command("dailyJobProvisioner0", new()
{
Create = @$"response=$(curl -s -L -o /dev/null -w \""%{{http_code}}\"" -X POST \\
-H 'Authorization: Bearer {dbtToken}' \\
-H 'Content-Type: application/json' \\
-d '{{\""cause\"": \""Generate manifest\"", \""steps_override\"": [\""dbt parse\""]}}' \\
{dbtHostUrl}/v2/accounts/{dbtAccountId}/jobs/{id}/run/)
if [ \""$response\"" -ge 200 ] && [ \""$response\"" -lt 300 ]; then
echo \""Success: HTTP status $response\""
exit 0
else
echo \""Failure: HTTP status $response\""
exit 1
fi
",
}, new CustomResourceOptions
{
DependsOn =
{
dailyJob,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dbtcloud.Job;
import com.pulumi.dbtcloud.JobArgs;
import com.pulumi.dbtcloud.inputs.JobTriggersArgs;
import com.pulumi.command.local.Command;
import com.pulumi.command.local.CommandArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// a periodic job, but we trigger it once with `dbt parse` as soon as it is created so we can defer to the environment it is in
// to do so, we use a local-exec provisioner, just make sure that the machine running Terraform has curl installed
var dailyJob = new Job("dailyJob", JobArgs.builder()
.environmentId(prodEnvironment.environmentId())
.executeSteps("dbt build")
.generateDocs(true)
.name("Daily job")
.numThreads(64)
.projectId(dbtProject.id())
.runGenerateSources(true)
.targetName("default")
.triggers(JobTriggersArgs.builder()
%!v(PANIC=Format method: interface conversion: model.Expression is *model.TemplateExpression, not *model.LiteralValueExpression))
.scheduleDays(
0,
1,
2,
3,
4,
5,
6)
.scheduleType("days_of_week")
.scheduleHours(0)
.build());
var dailyJobProvisioner0 = new Command("dailyJobProvisioner0", CommandArgs.builder()
.create("""
response=$(curl -s -L -o /dev/null -w \"%{http_code}\" -X POST \\
-H 'Authorization: Bearer %s' \\
-H 'Content-Type: application/json' \\
-d '{\"cause\": \"Generate manifest\", \"steps_override\": [\"dbt parse\"]}' \\
%s/v2/accounts/%s/jobs/%s/run/)
if [ \"$response\" -ge 200 ] && [ \"$response\" -lt 300 ]; then
echo \"Success: HTTP status $response\"
exit 0
else
echo \"Failure: HTTP status $response\"
exit 1
fi
", dbtToken,dbtHostUrl,dbtAccountId,id))
.build(), CustomResourceOptions.builder()
.dependsOn(List.of(dailyJob))
.build());
}
}
resources:
# a periodic job, but we trigger it once with `dbt parse` as soon as it is created so we can defer to the environment it is in
# to do so, we use a local-exec provisioner, just make sure that the machine running Terraform has curl installed
dailyJob:
type: dbtcloud:Job
name: daily_job
properties:
environmentId: ${prodEnvironment.environmentId}
executeSteps:
- dbt build
generateDocs: true
name: Daily job
numThreads: 64
projectId: ${dbtProject.id}
runGenerateSources: true
targetName: default
triggers:
github_webhook: false
git_provider_webhook: false
schedule: true
on_merge: false
scheduleDays:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
scheduleType: days_of_week
scheduleHours:
- 0
dailyJobProvisioner0:
type: command:local:Command
properties:
create: "response=$(curl -s -L -o /dev/null -w \\\"%{http_code}\\\" -X POST \\\\\n -H 'Authorization: Bearer ${dbtToken}' \\\\\n -H 'Content-Type: application/json' \\\\\n -d '{\\\"cause\\\": \\\"Generate manifest\\\", \\\"steps_override\\\": [\\\"dbt parse\\\"]}' \\\\\n ${dbtHostUrl}/v2/accounts/${dbtAccountId}/jobs/${id}/run/)\n \nif [ \\\"$response\\\" -ge 200 ] && [ \\\"$response\\\" -lt 300 ]; then\n echo \\\"Success: HTTP status $response\\\"\n exit 0\nelse\n echo \\\"Failure: HTTP status $response\\\"\n exit 1\nfi\n"
options:
dependsOn:
- ${dailyJob}
For allowing source freshness deferral
In the case that deferral is required so that we can use the source_status:fresher+ selector,
the process is more complicated as the job will be self deferring.
An example can be found in this GitHub issue.
Create Job Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Job(name: string, args: JobArgs, opts?: CustomResourceOptions);@overload
def Job(resource_name: str,
args: JobArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Job(resource_name: str,
opts: Optional[ResourceOptions] = None,
environment_id: Optional[int] = None,
triggers: Optional[JobTriggersArgs] = None,
project_id: Optional[int] = None,
execute_steps: Optional[Sequence[str]] = None,
name: Optional[str] = None,
run_compare_changes: Optional[bool] = None,
errors_on_lint_failure: Optional[bool] = None,
deferring_job_id: Optional[int] = None,
execution: Optional[JobExecutionArgs] = None,
force_node_selection: Optional[bool] = None,
generate_docs: Optional[bool] = None,
is_active: Optional[bool] = None,
job_completion_trigger_conditions: Optional[Sequence[JobJobCompletionTriggerConditionArgs]] = None,
job_type: Optional[str] = None,
compare_changes_flags: Optional[str] = None,
num_threads: Optional[int] = None,
deferring_environment_id: Optional[int] = None,
description: Optional[str] = None,
run_generate_sources: Optional[bool] = None,
run_lint: Optional[bool] = None,
schedule_cron: Optional[str] = None,
schedule_days: Optional[Sequence[int]] = None,
schedule_hours: Optional[Sequence[int]] = None,
schedule_interval: Optional[int] = None,
schedule_type: Optional[str] = None,
self_deferring: Optional[bool] = None,
target_name: Optional[str] = None,
timeout_seconds: Optional[int] = None,
dbt_version: Optional[str] = None,
triggers_on_draft_pr: Optional[bool] = None,
validate_execute_steps: Optional[bool] = None)func NewJob(ctx *Context, name string, args JobArgs, opts ...ResourceOption) (*Job, error)public Job(string name, JobArgs args, CustomResourceOptions? opts = null)type: dbtcloud:Job
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args JobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args JobArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args JobArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args JobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args JobArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var jobResource = new DbtCloud.Job("jobResource", new()
{
EnvironmentId = 0,
Triggers = new DbtCloud.Inputs.JobTriggersArgs
{
GitProviderWebhook = false,
GithubWebhook = false,
OnMerge = false,
Schedule = false,
},
ProjectId = 0,
ExecuteSteps = new[]
{
"string",
},
Name = "string",
RunCompareChanges = false,
ErrorsOnLintFailure = false,
DeferringJobId = 0,
Execution = new DbtCloud.Inputs.JobExecutionArgs
{
TimeoutSeconds = 0,
},
ForceNodeSelection = false,
GenerateDocs = false,
IsActive = false,
CompletionTriggerCondition = new[]
{
new DbtCloud.Inputs.JobJobCompletionTriggerConditionArgs
{
JobId = 0,
ProjectId = 0,
Statuses = new[]
{
"string",
},
},
},
JobType = "string",
CompareChangesFlags = "string",
NumThreads = 0,
DeferringEnvironmentId = 0,
Description = "string",
RunGenerateSources = false,
RunLint = false,
ScheduleCron = "string",
ScheduleDays = new[]
{
0,
},
ScheduleHours = new[]
{
0,
},
ScheduleInterval = 0,
ScheduleType = "string",
SelfDeferring = false,
TargetName = "string",
DbtVersion = "string",
TriggersOnDraftPr = false,
ValidateExecuteSteps = false,
});
example, err := dbtcloud.NewJob(ctx, "jobResource", &dbtcloud.JobArgs{
EnvironmentId: pulumi.Int(0),
Triggers: &dbtcloud.JobTriggersArgs{
GitProviderWebhook: pulumi.Bool(false),
GithubWebhook: pulumi.Bool(false),
OnMerge: pulumi.Bool(false),
Schedule: pulumi.Bool(false),
},
ProjectId: pulumi.Int(0),
ExecuteSteps: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
RunCompareChanges: pulumi.Bool(false),
ErrorsOnLintFailure: pulumi.Bool(false),
DeferringJobId: pulumi.Int(0),
Execution: &dbtcloud.JobExecutionArgs{
TimeoutSeconds: pulumi.Int(0),
},
ForceNodeSelection: pulumi.Bool(false),
GenerateDocs: pulumi.Bool(false),
IsActive: pulumi.Bool(false),
JobCompletionTriggerConditions: dbtcloud.JobJobCompletionTriggerConditionArray{
&dbtcloud.JobJobCompletionTriggerConditionArgs{
JobId: pulumi.Int(0),
ProjectId: pulumi.Int(0),
Statuses: pulumi.StringArray{
pulumi.String("string"),
},
},
},
JobType: pulumi.String("string"),
CompareChangesFlags: pulumi.String("string"),
NumThreads: pulumi.Int(0),
DeferringEnvironmentId: pulumi.Int(0),
Description: pulumi.String("string"),
RunGenerateSources: pulumi.Bool(false),
RunLint: pulumi.Bool(false),
ScheduleCron: pulumi.String("string"),
ScheduleDays: pulumi.IntArray{
pulumi.Int(0),
},
ScheduleHours: pulumi.IntArray{
pulumi.Int(0),
},
ScheduleInterval: pulumi.Int(0),
ScheduleType: pulumi.String("string"),
SelfDeferring: pulumi.Bool(false),
TargetName: pulumi.String("string"),
DbtVersion: pulumi.String("string"),
TriggersOnDraftPr: pulumi.Bool(false),
ValidateExecuteSteps: pulumi.Bool(false),
})
var jobResource = new Job("jobResource", JobArgs.builder()
.environmentId(0)
.triggers(JobTriggersArgs.builder()
.gitProviderWebhook(false)
.githubWebhook(false)
.onMerge(false)
.schedule(false)
.build())
.projectId(0)
.executeSteps("string")
.name("string")
.runCompareChanges(false)
.errorsOnLintFailure(false)
.deferringJobId(0)
.execution(JobExecutionArgs.builder()
.timeoutSeconds(0)
.build())
.forceNodeSelection(false)
.generateDocs(false)
.isActive(false)
.jobCompletionTriggerConditions(JobJobCompletionTriggerConditionArgs.builder()
.jobId(0)
.projectId(0)
.statuses("string")
.build())
.jobType("string")
.compareChangesFlags("string")
.numThreads(0)
.deferringEnvironmentId(0)
.description("string")
.runGenerateSources(false)
.runLint(false)
.scheduleCron("string")
.scheduleDays(0)
.scheduleHours(0)
.scheduleInterval(0)
.scheduleType("string")
.selfDeferring(false)
.targetName("string")
.dbtVersion("string")
.triggersOnDraftPr(false)
.validateExecuteSteps(false)
.build());
job_resource = dbtcloud.Job("jobResource",
environment_id=0,
triggers={
"git_provider_webhook": False,
"github_webhook": False,
"on_merge": False,
"schedule": False,
},
project_id=0,
execute_steps=["string"],
name="string",
run_compare_changes=False,
errors_on_lint_failure=False,
deferring_job_id=0,
execution={
"timeout_seconds": 0,
},
force_node_selection=False,
generate_docs=False,
is_active=False,
job_completion_trigger_conditions=[{
"job_id": 0,
"project_id": 0,
"statuses": ["string"],
}],
job_type="string",
compare_changes_flags="string",
num_threads=0,
deferring_environment_id=0,
description="string",
run_generate_sources=False,
run_lint=False,
schedule_cron="string",
schedule_days=[0],
schedule_hours=[0],
schedule_interval=0,
schedule_type="string",
self_deferring=False,
target_name="string",
dbt_version="string",
triggers_on_draft_pr=False,
validate_execute_steps=False)
const jobResource = new dbtcloud.Job("jobResource", {
environmentId: 0,
triggers: {
gitProviderWebhook: false,
githubWebhook: false,
onMerge: false,
schedule: false,
},
projectId: 0,
executeSteps: ["string"],
name: "string",
runCompareChanges: false,
errorsOnLintFailure: false,
deferringJobId: 0,
execution: {
timeoutSeconds: 0,
},
forceNodeSelection: false,
generateDocs: false,
isActive: false,
jobCompletionTriggerConditions: [{
jobId: 0,
projectId: 0,
statuses: ["string"],
}],
jobType: "string",
compareChangesFlags: "string",
numThreads: 0,
deferringEnvironmentId: 0,
description: "string",
runGenerateSources: false,
runLint: false,
scheduleCron: "string",
scheduleDays: [0],
scheduleHours: [0],
scheduleInterval: 0,
scheduleType: "string",
selfDeferring: false,
targetName: "string",
dbtVersion: "string",
triggersOnDraftPr: false,
validateExecuteSteps: false,
});
type: dbtcloud:Job
properties:
compareChangesFlags: string
dbtVersion: string
deferringEnvironmentId: 0
deferringJobId: 0
description: string
environmentId: 0
errorsOnLintFailure: false
executeSteps:
- string
execution:
timeoutSeconds: 0
forceNodeSelection: false
generateDocs: false
isActive: false
jobCompletionTriggerConditions:
- jobId: 0
projectId: 0
statuses:
- string
jobType: string
name: string
numThreads: 0
projectId: 0
runCompareChanges: false
runGenerateSources: false
runLint: false
scheduleCron: string
scheduleDays:
- 0
scheduleHours:
- 0
scheduleInterval: 0
scheduleType: string
selfDeferring: false
targetName: string
triggers:
gitProviderWebhook: false
githubWebhook: false
onMerge: false
schedule: false
triggersOnDraftPr: false
validateExecuteSteps: false
Job Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Job resource accepts the following input properties:
- Environment
Id int - Environment ID to create the job in
- Execute
Steps List<string> - List of commands to execute for the job
- Project
Id int - Project ID to create the job in
- Triggers
Pulumi.
Dbt Cloud. Inputs. Job Triggers - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - Compare
Changes stringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- Completion
Trigger List<Pulumi.Condition Dbt Cloud. Inputs. Job Job Completion Trigger Condition> - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- Dbt
Version string - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- Deferring
Environment intId - Environment identifier that this job defers to (new deferring approach)
- Deferring
Job intId - Job identifier that this job defers to (legacy deferring approach)
- Description string
- Description for the job
- Errors
On boolLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - Execution
Pulumi.
Dbt Cloud. Inputs. Job Execution - Execution settings for the job
- Force
Node boolSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - Generate
Docs bool - Flag for whether the job should generate documentation
- Is
Active bool - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - Job
Type string - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - Name string
- Job name
- Num
Threads int - Number of threads to use in the job
- Run
Compare boolChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - Run
Generate boolSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - Run
Lint bool - Whether the CI job should lint SQL changes. Defaults to
false. - Schedule
Cron string - Custom cron expression for schedule
- Schedule
Days List<int> - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- Schedule
Hours List<int> - List of hours to execute the job at if running on a schedule
- Schedule
Interval int - Number of hours between job executions if running on a schedule
- Schedule
Type string - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- Self
Deferring bool - Whether this job defers on a previous run of itself
- Target
Name string - Target name for the dbt profile
- Timeout
Seconds int - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- Triggers
On boolDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- Validate
Execute boolSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- Environment
Id int - Environment ID to create the job in
- Execute
Steps []string - List of commands to execute for the job
- Project
Id int - Project ID to create the job in
- Triggers
Job
Triggers Args - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - Compare
Changes stringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- Dbt
Version string - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- Deferring
Environment intId - Environment identifier that this job defers to (new deferring approach)
- Deferring
Job intId - Job identifier that this job defers to (legacy deferring approach)
- Description string
- Description for the job
- Errors
On boolLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - Execution
Job
Execution Args - Execution settings for the job
- Force
Node boolSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - Generate
Docs bool - Flag for whether the job should generate documentation
- Is
Active bool - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - Job
Completion []JobTrigger Conditions Job Completion Trigger Condition Args - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- Job
Type string - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - Name string
- Job name
- Num
Threads int - Number of threads to use in the job
- Run
Compare boolChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - Run
Generate boolSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - Run
Lint bool - Whether the CI job should lint SQL changes. Defaults to
false. - Schedule
Cron string - Custom cron expression for schedule
- Schedule
Days []int - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- Schedule
Hours []int - List of hours to execute the job at if running on a schedule
- Schedule
Interval int - Number of hours between job executions if running on a schedule
- Schedule
Type string - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- Self
Deferring bool - Whether this job defers on a previous run of itself
- Target
Name string - Target name for the dbt profile
- Timeout
Seconds int - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- Triggers
On boolDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- Validate
Execute boolSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- environment
Id Integer - Environment ID to create the job in
- execute
Steps List<String> - List of commands to execute for the job
- project
Id Integer - Project ID to create the job in
- triggers
Job
Triggers - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - compare
Changes StringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt
Version String - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring
Environment IntegerId - Environment identifier that this job defers to (new deferring approach)
- deferring
Job IntegerId - Job identifier that this job defers to (legacy deferring approach)
- description String
- Description for the job
- errors
On BooleanLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execution
Job
Execution - Execution settings for the job
- force
Node BooleanSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate
Docs Boolean - Flag for whether the job should generate documentation
- is
Active Boolean - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job
Completion List<JobTrigger Conditions Job Completion Trigger Condition> - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job
Type String - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name String
- Job name
- num
Threads Integer - Number of threads to use in the job
- run
Compare BooleanChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run
Generate BooleanSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run
Lint Boolean - Whether the CI job should lint SQL changes. Defaults to
false. - schedule
Cron String - Custom cron expression for schedule
- schedule
Days List<Integer> - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule
Hours List<Integer> - List of hours to execute the job at if running on a schedule
- schedule
Interval Integer - Number of hours between job executions if running on a schedule
- schedule
Type String - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self
Deferring Boolean - Whether this job defers on a previous run of itself
- target
Name String - Target name for the dbt profile
- timeout
Seconds Integer - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers
On BooleanDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- validate
Execute BooleanSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- environment
Id number - Environment ID to create the job in
- execute
Steps string[] - List of commands to execute for the job
- project
Id number - Project ID to create the job in
- triggers
Job
Triggers - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - compare
Changes stringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt
Version string - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring
Environment numberId - Environment identifier that this job defers to (new deferring approach)
- deferring
Job numberId - Job identifier that this job defers to (legacy deferring approach)
- description string
- Description for the job
- errors
On booleanLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execution
Job
Execution - Execution settings for the job
- force
Node booleanSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate
Docs boolean - Flag for whether the job should generate documentation
- is
Active boolean - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job
Completion JobTrigger Conditions Job Completion Trigger Condition[] - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job
Type string - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name string
- Job name
- num
Threads number - Number of threads to use in the job
- run
Compare booleanChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run
Generate booleanSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run
Lint boolean - Whether the CI job should lint SQL changes. Defaults to
false. - schedule
Cron string - Custom cron expression for schedule
- schedule
Days number[] - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule
Hours number[] - List of hours to execute the job at if running on a schedule
- schedule
Interval number - Number of hours between job executions if running on a schedule
- schedule
Type string - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self
Deferring boolean - Whether this job defers on a previous run of itself
- target
Name string - Target name for the dbt profile
- timeout
Seconds number - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers
On booleanDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- validate
Execute booleanSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- environment_
id int - Environment ID to create the job in
- execute_
steps Sequence[str] - List of commands to execute for the job
- project_
id int - Project ID to create the job in
- triggers
Job
Triggers Args - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - compare_
changes_ strflags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt_
version str - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring_
environment_ intid - Environment identifier that this job defers to (new deferring approach)
- deferring_
job_ intid - Job identifier that this job defers to (legacy deferring approach)
- description str
- Description for the job
- errors_
on_ boollint_ failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execution
Job
Execution Args - Execution settings for the job
- force_
node_ boolselection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate_
docs bool - Flag for whether the job should generate documentation
- is_
active bool - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job_
completion_ Sequence[Jobtrigger_ conditions Job Completion Trigger Condition Args] - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job_
type str - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name str
- Job name
- num_
threads int - Number of threads to use in the job
- run_
compare_ boolchanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run_
generate_ boolsources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run_
lint bool - Whether the CI job should lint SQL changes. Defaults to
false. - schedule_
cron str - Custom cron expression for schedule
- schedule_
days Sequence[int] - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule_
hours Sequence[int] - List of hours to execute the job at if running on a schedule
- schedule_
interval int - Number of hours between job executions if running on a schedule
- schedule_
type str - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self_
deferring bool - Whether this job defers on a previous run of itself
- target_
name str - Target name for the dbt profile
- timeout_
seconds int - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers_
on_ booldraft_ pr - Whether the CI job should be automatically triggered on draft PRs
- validate_
execute_ boolsteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- environment
Id Number - Environment ID to create the job in
- execute
Steps List<String> - List of commands to execute for the job
- project
Id Number - Project ID to create the job in
- triggers Property Map
- Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - compare
Changes StringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt
Version String - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring
Environment NumberId - Environment identifier that this job defers to (new deferring approach)
- deferring
Job NumberId - Job identifier that this job defers to (legacy deferring approach)
- description String
- Description for the job
- errors
On BooleanLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execution Property Map
- Execution settings for the job
- force
Node BooleanSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate
Docs Boolean - Flag for whether the job should generate documentation
- is
Active Boolean - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job
Completion List<Property Map>Trigger Conditions - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job
Type String - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name String
- Job name
- num
Threads Number - Number of threads to use in the job
- run
Compare BooleanChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run
Generate BooleanSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run
Lint Boolean - Whether the CI job should lint SQL changes. Defaults to
false. - schedule
Cron String - Custom cron expression for schedule
- schedule
Days List<Number> - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule
Hours List<Number> - List of hours to execute the job at if running on a schedule
- schedule
Interval Number - Number of hours between job executions if running on a schedule
- schedule
Type String - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self
Deferring Boolean - Whether this job defers on a previous run of itself
- target
Name String - Target name for the dbt profile
- timeout
Seconds Number - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers
On BooleanDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- validate
Execute BooleanSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
Outputs
All input properties are implicitly available as output properties. Additionally, the Job resource produces the following output properties:
Look up Existing Job Resource
Get an existing Job resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: JobState, opts?: CustomResourceOptions): Job@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compare_changes_flags: Optional[str] = None,
dbt_version: Optional[str] = None,
deferring_environment_id: Optional[int] = None,
deferring_job_id: Optional[int] = None,
description: Optional[str] = None,
environment_id: Optional[int] = None,
errors_on_lint_failure: Optional[bool] = None,
execute_steps: Optional[Sequence[str]] = None,
execution: Optional[JobExecutionArgs] = None,
force_node_selection: Optional[bool] = None,
generate_docs: Optional[bool] = None,
is_active: Optional[bool] = None,
job_completion_trigger_conditions: Optional[Sequence[JobJobCompletionTriggerConditionArgs]] = None,
job_id: Optional[int] = None,
job_type: Optional[str] = None,
name: Optional[str] = None,
num_threads: Optional[int] = None,
project_id: Optional[int] = None,
run_compare_changes: Optional[bool] = None,
run_generate_sources: Optional[bool] = None,
run_lint: Optional[bool] = None,
schedule_cron: Optional[str] = None,
schedule_days: Optional[Sequence[int]] = None,
schedule_hours: Optional[Sequence[int]] = None,
schedule_interval: Optional[int] = None,
schedule_type: Optional[str] = None,
self_deferring: Optional[bool] = None,
target_name: Optional[str] = None,
timeout_seconds: Optional[int] = None,
triggers: Optional[JobTriggersArgs] = None,
triggers_on_draft_pr: Optional[bool] = None,
validate_execute_steps: Optional[bool] = None) -> Jobfunc GetJob(ctx *Context, name string, id IDInput, state *JobState, opts ...ResourceOption) (*Job, error)public static Job Get(string name, Input<string> id, JobState? state, CustomResourceOptions? opts = null)public static Job get(String name, Output<String> id, JobState state, CustomResourceOptions options)resources: _: type: dbtcloud:Job get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Compare
Changes stringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- Completion
Trigger List<Pulumi.Condition Dbt Cloud. Inputs. Job Job Completion Trigger Condition> - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- Dbt
Version string - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- Deferring
Environment intId - Environment identifier that this job defers to (new deferring approach)
- Deferring
Job intId - Job identifier that this job defers to (legacy deferring approach)
- Description string
- Description for the job
- Environment
Id int - Environment ID to create the job in
- Errors
On boolLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - Execute
Steps List<string> - List of commands to execute for the job
- Execution
Pulumi.
Dbt Cloud. Inputs. Job Execution - Execution settings for the job
- Force
Node boolSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - Generate
Docs bool - Flag for whether the job should generate documentation
- Is
Active bool - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - Job
Id int - Job identifier
- Job
Type string - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - Name string
- Job name
- Num
Threads int - Number of threads to use in the job
- Project
Id int - Project ID to create the job in
- Run
Compare boolChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - Run
Generate boolSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - Run
Lint bool - Whether the CI job should lint SQL changes. Defaults to
false. - Schedule
Cron string - Custom cron expression for schedule
- Schedule
Days List<int> - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- Schedule
Hours List<int> - List of hours to execute the job at if running on a schedule
- Schedule
Interval int - Number of hours between job executions if running on a schedule
- Schedule
Type string - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- Self
Deferring bool - Whether this job defers on a previous run of itself
- Target
Name string - Target name for the dbt profile
- Timeout
Seconds int - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- Triggers
Pulumi.
Dbt Cloud. Inputs. Job Triggers - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - Triggers
On boolDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- Validate
Execute boolSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- Compare
Changes stringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- Dbt
Version string - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- Deferring
Environment intId - Environment identifier that this job defers to (new deferring approach)
- Deferring
Job intId - Job identifier that this job defers to (legacy deferring approach)
- Description string
- Description for the job
- Environment
Id int - Environment ID to create the job in
- Errors
On boolLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - Execute
Steps []string - List of commands to execute for the job
- Execution
Job
Execution Args - Execution settings for the job
- Force
Node boolSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - Generate
Docs bool - Flag for whether the job should generate documentation
- Is
Active bool - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - Job
Completion []JobTrigger Conditions Job Completion Trigger Condition Args - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- Job
Id int - Job identifier
- Job
Type string - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - Name string
- Job name
- Num
Threads int - Number of threads to use in the job
- Project
Id int - Project ID to create the job in
- Run
Compare boolChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - Run
Generate boolSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - Run
Lint bool - Whether the CI job should lint SQL changes. Defaults to
false. - Schedule
Cron string - Custom cron expression for schedule
- Schedule
Days []int - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- Schedule
Hours []int - List of hours to execute the job at if running on a schedule
- Schedule
Interval int - Number of hours between job executions if running on a schedule
- Schedule
Type string - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- Self
Deferring bool - Whether this job defers on a previous run of itself
- Target
Name string - Target name for the dbt profile
- Timeout
Seconds int - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- Triggers
Job
Triggers Args - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - Triggers
On boolDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- Validate
Execute boolSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- compare
Changes StringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt
Version String - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring
Environment IntegerId - Environment identifier that this job defers to (new deferring approach)
- deferring
Job IntegerId - Job identifier that this job defers to (legacy deferring approach)
- description String
- Description for the job
- environment
Id Integer - Environment ID to create the job in
- errors
On BooleanLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execute
Steps List<String> - List of commands to execute for the job
- execution
Job
Execution - Execution settings for the job
- force
Node BooleanSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate
Docs Boolean - Flag for whether the job should generate documentation
- is
Active Boolean - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job
Completion List<JobTrigger Conditions Job Completion Trigger Condition> - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job
Id Integer - Job identifier
- job
Type String - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name String
- Job name
- num
Threads Integer - Number of threads to use in the job
- project
Id Integer - Project ID to create the job in
- run
Compare BooleanChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run
Generate BooleanSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run
Lint Boolean - Whether the CI job should lint SQL changes. Defaults to
false. - schedule
Cron String - Custom cron expression for schedule
- schedule
Days List<Integer> - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule
Hours List<Integer> - List of hours to execute the job at if running on a schedule
- schedule
Interval Integer - Number of hours between job executions if running on a schedule
- schedule
Type String - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self
Deferring Boolean - Whether this job defers on a previous run of itself
- target
Name String - Target name for the dbt profile
- timeout
Seconds Integer - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers
Job
Triggers - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - triggers
On BooleanDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- validate
Execute BooleanSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- compare
Changes stringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt
Version string - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring
Environment numberId - Environment identifier that this job defers to (new deferring approach)
- deferring
Job numberId - Job identifier that this job defers to (legacy deferring approach)
- description string
- Description for the job
- environment
Id number - Environment ID to create the job in
- errors
On booleanLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execute
Steps string[] - List of commands to execute for the job
- execution
Job
Execution - Execution settings for the job
- force
Node booleanSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate
Docs boolean - Flag for whether the job should generate documentation
- is
Active boolean - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job
Completion JobTrigger Conditions Job Completion Trigger Condition[] - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job
Id number - Job identifier
- job
Type string - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name string
- Job name
- num
Threads number - Number of threads to use in the job
- project
Id number - Project ID to create the job in
- run
Compare booleanChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run
Generate booleanSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run
Lint boolean - Whether the CI job should lint SQL changes. Defaults to
false. - schedule
Cron string - Custom cron expression for schedule
- schedule
Days number[] - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule
Hours number[] - List of hours to execute the job at if running on a schedule
- schedule
Interval number - Number of hours between job executions if running on a schedule
- schedule
Type string - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self
Deferring boolean - Whether this job defers on a previous run of itself
- target
Name string - Target name for the dbt profile
- timeout
Seconds number - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers
Job
Triggers - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - triggers
On booleanDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- validate
Execute booleanSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- compare_
changes_ strflags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt_
version str - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring_
environment_ intid - Environment identifier that this job defers to (new deferring approach)
- deferring_
job_ intid - Job identifier that this job defers to (legacy deferring approach)
- description str
- Description for the job
- environment_
id int - Environment ID to create the job in
- errors_
on_ boollint_ failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execute_
steps Sequence[str] - List of commands to execute for the job
- execution
Job
Execution Args - Execution settings for the job
- force_
node_ boolselection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate_
docs bool - Flag for whether the job should generate documentation
- is_
active bool - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job_
completion_ Sequence[Jobtrigger_ conditions Job Completion Trigger Condition Args] - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job_
id int - Job identifier
- job_
type str - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name str
- Job name
- num_
threads int - Number of threads to use in the job
- project_
id int - Project ID to create the job in
- run_
compare_ boolchanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run_
generate_ boolsources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run_
lint bool - Whether the CI job should lint SQL changes. Defaults to
false. - schedule_
cron str - Custom cron expression for schedule
- schedule_
days Sequence[int] - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule_
hours Sequence[int] - List of hours to execute the job at if running on a schedule
- schedule_
interval int - Number of hours between job executions if running on a schedule
- schedule_
type str - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self_
deferring bool - Whether this job defers on a previous run of itself
- target_
name str - Target name for the dbt profile
- timeout_
seconds int - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers
Job
Triggers Args - Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - triggers_
on_ booldraft_ pr - Whether the CI job should be automatically triggered on draft PRs
- validate_
execute_ boolsteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
- compare
Changes StringFlags - The model selector for checking changes in the compare changes Advanced CI feature
- dbt
Version String - Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
- deferring
Environment NumberId - Environment identifier that this job defers to (new deferring approach)
- deferring
Job NumberId - Job identifier that this job defers to (legacy deferring approach)
- description String
- Description for the job
- environment
Id Number - Environment ID to create the job in
- errors
On BooleanLint Failure - Whether the CI job should fail when a lint error is found. Only used when
run_lintis set totrue. Defaults totrue. - execute
Steps List<String> - List of commands to execute for the job
- execution Property Map
- Execution settings for the job
- force
Node BooleanSelection - Whether to force node selection (SAO - Select All Optimizations) for the job. If
dbt_versionis not set tolatest-fusion, this must be set totruewhen specified. - generate
Docs Boolean - Flag for whether the job should generate documentation
- is
Active Boolean - Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the
triggersconfig. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true. - job
Completion List<Property Map>Trigger Conditions - Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining').
- job
Id Number - Job identifier
- job
Type String - Can be used to enforce the job type betwen
ci,mergeandscheduled. Without this value the job type is inferred from the triggers configured - name String
- Job name
- num
Threads Number - Number of threads to use in the job
- project
Id Number - Project ID to create the job in
- run
Compare BooleanChanges - Whether the CI job should compare data changes introduced by the code changes. Requires
deferring_environment_idto be set. (Advanced CI needs to be activated in the dbt Cloud Account Settings first as well) - run
Generate BooleanSources - Flag for whether the job should add a
dbt source freshnessstep to the job. The difference between manually adding a step withdbt source freshnessin the job steps or using this flag is that with this flag, a failed freshness will still allow the following steps to run. - run
Lint Boolean - Whether the CI job should lint SQL changes. Defaults to
false. - schedule
Cron String - Custom cron expression for schedule
- schedule
Days List<Number> - List of days of week as numbers (0 = Sunday, 7 = Saturday) to execute the job at if running on a schedule
- schedule
Hours List<Number> - List of hours to execute the job at if running on a schedule
- schedule
Interval Number - Number of hours between job executions if running on a schedule
- schedule
Type String - Type of schedule to use, one of everyday/ daysofweek/ customcron/ interval_cron
- self
Deferring Boolean - Whether this job defers on a previous run of itself
- target
Name String - Target name for the dbt profile
- timeout
Seconds Number - Number of seconds to allow the job to run before timing out. Use execution.timeout_seconds instead.
- triggers Property Map
- Flags for which types of triggers to use, the values are
github_webhook,git_provider_webhook,scheduleandon_merge. All flags should be listed and set withtrueorfalse. Whenon_mergeistrue, all the other values must be false.\n\ncustom_branch_onlyused to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove thecustom_branch_onlyfrom your config. \n\nTo create a job in a 'deactivated' state, set all tofalse. - triggers
On BooleanDraft Pr - Whether the CI job should be automatically triggered on draft PRs
- validate
Execute BooleanSteps - When set to
true, the provider will validate theexecute_stepsduring plan time to ensure they contain valid dbt commands. If a command is not recognized (e.g., a new dbt command not yet supported by the provider), the validation will fail. Defaults tofalseto allow flexibility with newer dbt commands.
Supporting Types
JobExecution, JobExecutionArgs
- Timeout
Seconds int - The number of seconds before the job times out
- Timeout
Seconds int - The number of seconds before the job times out
- timeout
Seconds Integer - The number of seconds before the job times out
- timeout
Seconds number - The number of seconds before the job times out
- timeout_
seconds int - The number of seconds before the job times out
- timeout
Seconds Number - The number of seconds before the job times out
JobJobCompletionTriggerCondition, JobJobCompletionTriggerConditionArgs
- job_
id int - The ID of the job that would trigger this job after completion.
- project_
id int - The ID of the project where the trigger job is running in.
- statuses Sequence[str]
- List of statuses to trigger the job on. Possible values are
success,errorandcanceled.
JobTriggers, JobTriggersArgs
- Git
Provider boolWebhook - Whether the job runs automatically on PR creation
- Github
Webhook bool - Whether the job runs automatically on PR creation
- On
Merge bool - Whether the job runs automatically once a PR is merged
- Schedule bool
- Whether the job runs on a schedule
- Git
Provider boolWebhook - Whether the job runs automatically on PR creation
- Github
Webhook bool - Whether the job runs automatically on PR creation
- On
Merge bool - Whether the job runs automatically once a PR is merged
- Schedule bool
- Whether the job runs on a schedule
- git
Provider BooleanWebhook - Whether the job runs automatically on PR creation
- github
Webhook Boolean - Whether the job runs automatically on PR creation
- on
Merge Boolean - Whether the job runs automatically once a PR is merged
- schedule Boolean
- Whether the job runs on a schedule
- git
Provider booleanWebhook - Whether the job runs automatically on PR creation
- github
Webhook boolean - Whether the job runs automatically on PR creation
- on
Merge boolean - Whether the job runs automatically once a PR is merged
- schedule boolean
- Whether the job runs on a schedule
- git_
provider_ boolwebhook - Whether the job runs automatically on PR creation
- github_
webhook bool - Whether the job runs automatically on PR creation
- on_
merge bool - Whether the job runs automatically once a PR is merged
- schedule bool
- Whether the job runs on a schedule
- git
Provider BooleanWebhook - Whether the job runs automatically on PR creation
- github
Webhook Boolean - Whether the job runs automatically on PR creation
- on
Merge Boolean - Whether the job runs automatically once a PR is merged
- schedule Boolean
- Whether the job runs on a schedule
Import
using import blocks (requires Terraform >= 1.5) import { to = dbtcloud_job.my_job id = <span pulumi-lang-nodejs=““jobId”” pulumi-lang-dotnet=““JobId”” pulumi-lang-go=““jobId”” pulumi-lang-python=““job_id”” pulumi-lang-yaml=““jobId”” pulumi-lang-java=““jobId”">“job_id” }
import { to = dbtcloud_job.my_job id = “12345” }
using the older import command
$ pulumi import dbtcloud:index/job:Job my_job "job_id"
$ pulumi import dbtcloud:index/job:Job my_job 12345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- dbtcloud pulumi/pulumi-dbtcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
dbtcloudTerraform Provider.
