-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathresource.tf
More file actions
113 lines (106 loc) · 3.35 KB
/
resource.tf
File metadata and controls
113 lines (106 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# a job that has github_webhook and git_provider_webhook
# set to false will be categorized as a "Deploy Job"
resource "dbtcloud_job" "daily_job" {
environment_id = dbtcloud_environment.prod_environment.environment_id
execute_steps = [
"dbt build"
]
generate_docs = true
is_active = true
name = "Daily job"
num_threads = 64
project_id = dbtcloud_project.dbt_project.id
run_generate_sources = true
target_name = "default"
triggers = {
"github_webhook" : false
"git_provider_webhook" : false
"schedule" : true
"on_merge" : false
}
# this is the default that gets set up when modifying jobs in the UI
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_type = "days_of_week"
schedule_hours = [0]
execution = {
timeout_seconds = 1800
}
}
# a job that has github_webhook and git_provider_webhook set
# to true will be categorized as a "Continuous Integration Job"
resource "dbtcloud_job" "ci_job" {
environment_id = dbtcloud_environment.ci_environment.environment_id
execute_steps = [
"dbt build -s state:modified+ --fail-fast"
]
generate_docs = false
deferring_environment_id = dbtcloud_environment.prod_environment.environment_id
name = "CI Job"
num_threads = 32
project_id = dbtcloud_project.dbt_project.id
run_generate_sources = false
run_lint = true
errors_on_lint_failure = true
triggers = {
"github_webhook" : true
"git_provider_webhook" : true
"schedule" : false
"on_merge" : false
}
# this is the default that gets set up when modifying jobs in the UI
# this is not going to be used when schedule is set to false
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_type = "days_of_week"
execution = {
timeout_seconds = 3600
}
}
# a job that is set to be triggered after another job finishes
# this is sometimes referred as 'job chaining'
resource "dbtcloud_job" "downstream_job" {
environment_id = dbtcloud_environment.project2_prod_environment.environment_id
execute_steps = [
"dbt build -s +my_model"
]
generate_docs = true
name = "Downstream job in project 2"
num_threads = 32
project_id = dbtcloud_project.dbt_project2.id
run_generate_sources = true
triggers = {
"github_webhook" : false
"git_provider_webhook" : false
"schedule" : false
"on_merge" : false
}
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_type = "days_of_week"
job_completion_trigger_condition {
job_id = dbtcloud_job.daily_job.id
project_id = dbtcloud_project.dbt_project.id
statuses = ["success"]
}
}
# a job that uses the interval cron setup
resource "dbtcloud_job" "daily_job" {
environment_id = dbtcloud_environment.prod_environment.environment_id
execute_steps = [
"dbt build"
]
generate_docs = true
is_active = true
name = "Daily job"
num_threads = 64
project_id = dbtcloud_project.dbt_project.id
run_generate_sources = true
target_name = "default"
triggers = {
"github_webhook" : false
"git_provider_webhook" : false
"schedule" : true
"on_merge" : false
}
schedule_type = "interval_cron"
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_interval = 5
}