-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
284 lines (247 loc) · 6.4 KB
/
variables.tf
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# Project and Region
variable "project" {
type = string
description = "The GCP project ID"
}
variable "region" {
type = string
description = "The GCP region"
}
# Daemon Configuration
variable "daemon_zone" {
type = string
description = "The zone where the daemon will run"
}
variable "daemon_machine_type" {
type = string
default = "e2-small"
description = "The machine type for the daemon instance"
}
variable "daemon_image" {
type = string
description = "The image to use for the daemon instance"
}
variable "daemon_args" {
type = list(string)
default = ["dagster-daemon", "run"]
description = "Arguments to pass to the daemon"
}
variable "daemon_instance_name" {
type = string
description = "Name of the daemon instance"
default = "dagster-daemon"
}
# Database Configuration
variable "db_instance_name" {
type = string
description = "Name of the Cloud SQL instance to connect to"
}
variable "db_instance_private_ip" {
type = string
description = "Private IP of the Cloud SQL instance to connect to"
}
variable "db_database_name" {
type = string
default = "dagster"
description = "Name of the database to create"
}
variable "db_user" {
type = string
default = "dagster"
description = "Name of the database user to create"
}
variable "db_schema" {
type = string
default = "public"
description = "Name of the database schema to use"
}
# Network Configuration
variable "vpc_connector_id" {
type = string
description = "ID of the VPC connector to use for Cloud Run services and jobs"
}
variable "network" {
type = string
description = "Name of the VPC to use for services, jobs, and daemon. Must be the same network as DB instance."
}
variable "subnetwork" {
type = string
description = "Name of the subnet to use for services, jobs, and daemon. Must be the same subnet as DB instance."
}
# Webserver Configuration
variable "webserver_image" {
type = string
description = "The image to use for the webserver"
}
variable "webserver_args" {
type = list(string)
default = ["dagster-webserver", "--host", "0.0.0.0", "--port", "3000"]
description = "Arguments to pass to the webserver"
}
variable "webserver_env" {
type = list(object({
name = string
value = string
}))
default = []
description = "Environment variables for the webserver"
}
variable "webserver_env_secrets" {
type = list(object({
name = string
secret_id = string
}))
default = []
description = "Environment variables for the webserver from secrets"
}
variable "webserver_port" {
type = number
default = 3000
description = "Port on which the webserver will run"
}
variable "webserver_resources" {
type = object({
limits = object({
cpu = string
memory = string
})
cpu_idle = bool
startup_cpu_boost = bool
})
default = {
limits = {
cpu = "1"
memory = "2Gi"
}
cpu_idle = true
startup_cpu_boost = true
}
description = "Resources for the webserver"
}
variable "webserver_startup_probe" {
type = object({
initial_delay_seconds = number
timeout_seconds = number
period_seconds = number
failure_threshold = number
http_path = string
http_port = number
})
default = {
initial_delay_seconds = 0
timeout_seconds = 30
period_seconds = 30
failure_threshold = 3
http_path = "/server_info"
http_port = 3000
}
description = "Startup probe configuration for the webserver"
}
variable "webserver_ingress" {
type = string
default = "INGRESS_TRAFFIC_INTERNAL_ONLY"
description = "Ingress traffic setting for the webserver"
}
variable "webserver_min_instance_count" {
type = number
default = 0
description = "Minimum number of instances to run for the webserver"
}
variable "webserver_max_instance_count" {
type = number
default = 1
description = "Maximum number of instances to run for the webserver"
}
variable "webserver_service_name" {
type = string
description = "Name of the webserver service"
default = "dagster-webserver"
}
variable "webserver_max_instance_request_concurrency" {
type = number
default = 80
description = "Maximum number of requests a single webserver instance can handle at a time"
}
# Code location configuration
variable "code_server_resources" {
type = object({
limits = object({
cpu = string
memory = string
})
cpu_idle = bool
})
default = {
limits = {
cpu = "1"
memory = "1Gi"
}
cpu_idle = true
}
description = "Resources for the code server"
}
variable "code_locations" {
type = map(object({
image = string
run_worker_resources_limits = object({
cpu = string
memory = string
})
module_name = string
port = number
}))
description = "Configuration for code locations"
}
# Logging and Monitoring
variable "log_bucket" {
type = string
description = "GCS bucket for logs"
}
variable "log_bucket_retention_days" {
type = number
default = 30
description = "Retention period for logs in days"
}
variable "io_bucket" {
type = string
description = "GCS bucket for input/output"
}
# Service Accounts
variable "primary_service_account_name" {
type = string
description = "Name of the primary service account to use for the webserver, daemon, and code servers"
default = "dagster"
}
variable "run_worker_service_account_prefix" {
type = string
description = "Prefix for the service account names for the run workers"
default = "dagster-run-worker-"
}
# Run Worker Configuration
variable "run_worker_job_timeout_seconds" {
type = number
default = 86400
description = "Job timeout in seconds for run workers"
}
# Miscellaneous
variable "labels" {
type = map(string)
default = {
application = "dagster"
}
description = "Labels to apply to resources"
}
variable "execution_environment" {
type = string
default = "EXECUTION_ENVIRONMENT_GEN1"
description = "Execution environment for all Cloud Run services"
}
variable "artifact_registry_repository" {
type = object({
name = string
location = string
project = string
})
description = "Name of the artifact registry repository, used to grant pull access to service accounts (optional)"
default = null
}