forked from larribas/terraform-aws-mlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
402 lines (338 loc) · 11.6 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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
variable "unique_name" {
type = string
description = "A unique name for this application (e.g. mlflow-team-name)"
}
variable "tags" {
type = map(string)
default = {}
description = "AWS Tags common to all the resources created"
}
variable "vpc_id" {
type = string
default = null
description = "AWS VPC to deploy MLflow into"
}
variable "launch_in_existing_cluster" {
type = bool
default = false
description = "If you want to launch a new mlflow instance in an existing ECS cluster"
}
variable "existing_cluster_id" {
type = string
default = null
description = "Existing ECS cluster id"
}
variable "existing_lb_listener_arn" {
type = string
default = null
description = "Existing ECS load balancer listener ARN"
}
variable "existing_lb_target_group_arn" {
type = string
default = null
description = "Existing ECS load balancer target group ARN"
}
variable "existing_capacity_provider_name" {
type = string
default = null
description = "Existing ECS capacity provider name"
}
variable "existing_service_execution_role_id" {
type = string
default = null
}
variable "existing_service_task_role_id" {
type = string
default = null
}
variable "create_iam_roles" {
type = bool
default = true
description = "By default the module will create all necessary roles, if you want to use existing set this to false."
}
variable "ecs_task_role_name" {
type = string
default = null
description = "ECS task role name."
}
variable "ecs_execution_role_name" {
type = string
default = null
description = "ECS execution role name."
}
variable "ecs_launch_type" {
type = string
default = "FARGATE"
description = "ECS launch type. Can be EC2 or FARGATE, by default FARGATE."
}
variable "ec2_template_instance_type" {
type = string
default = null
description = "EC2 template instance type. Mandatory if ecs_launch_type is EC2"
}
variable "ec2_instance_profile_name" {
type = string
default = null
description = " The IAM Instance Profile to launch the instance with."
}
variable "ecs_service_count" {
type = number
default = 2
description = "Number of replicas to deploy. Defualt 2."
}
variable "ecs_min_instance_count" {
type = number
default = 1
description = "Minimum number of instances for the ecs cluster."
}
variable "ecs_max_instance_count" {
type = number
default = 2
description = "Maximum number of instances for the ecs cluster."
}
variable "ecs_external_security_group_id" {
type = string
default = null
description = "If you want to use an existing security group for the ECS service instead of creting a new one."
}
variable "ecs_subnet_ids" {
type = list(string)
default = null
description = "List of subnets where the ECS cluster instances will be deployed"
}
variable "cloudwatch_log_group_external_name" {
type = string
default = null
description = "To use an existing cloud watch log group, name."
}
variable "load_balancer_subnet_ids" {
type = list(string)
default = null
description = "List of subnets where the Load Balancer will be deployed"
}
variable "load_balancer_idle_timeout" {
type = number
default = 60
description = "Load balancer idle timeout in seconds; default: 60 seconds"
}
variable "load_balancer_ingress_cidr_blocks" {
type = list(string)
default = null
description = "CIDR blocks from where to allow traffic to the Load Balancer. If this is null, load_balancer_ingress_sg_id must be set."
}
variable "load_balancer_ingress_sg_id" {
type = string
default = null
description = "Security group from where to allow traffic to the Load Balancer. If this is null, load_balancer_ingress_cidr_blocks must be set."
}
variable "load_balancer_is_internal" {
type = bool
default = true
description = "By default, the load balancer is internal. This is because as of v1.9.1, MLflow doesn't have native authentication or authorization. We recommend exposing MLflow behind a VPN or using OIDC/Cognito together with the LB listener."
}
variable "load_balancer_external_security_group_id" {
type = string
default = null
description = "If you want to use an existing security group for the lb instead of creting a new one."
}
variable "load_balancer_listen_https" {
type = bool
default = false
description = "If you want the load balancer to support HTTPS."
}
variable "load_balancer_ssl_cert_arn" {
type = string
default = null
description = "If you want the load balancer to support HTTPS, the SSL certificate to use."
}
variable "load_balancer_host_header" {
type = string
default = null
description = "If you want to listen to a specific host header."
}
variable "service_image" {
type = string
default = null
description = "The MLflow docker image to deploy, if not by default it will get https://hub.docker.com/r/larribas/mlflow from the public registry"
}
variable "service_subnet_ids" {
type = list(string)
description = "List of subnets where the MLflow ECS service will be deployed (the recommendation is to use subnets that cannot be accessed directly from the Internet)"
}
variable "service_image_tag" {
type = string
default = "1.9.1"
description = "The MLflow version to deploy. Note that this version has to be available as a tag here: https://hub.docker.com/r/larribas/mlflow"
}
variable "private_repository_secret" {
type = string
default = null
description = "The ARN of the secret that has the credentials to your private image repository."
}
variable "service_cpu" {
type = number
default = 2048
description = "The number of CPU units reserved for the MLflow container"
}
variable "service_memory" {
type = number
default = 3886
description = "The amount (in MiB) of memory reserved for the MLflow container"
}
variable "service_log_retention_in_days" {
type = number
default = 90
description = "The number of days to keep logs around"
}
variable "service_sidecar_container_definitions" {
default = []
description = "A list of container definitions to deploy alongside the main container. See: https://www.terraform.io/docs/providers/aws/r/ecs_task_definition.html#container_definitions"
}
variable "service_min_capacity" {
type = number
default = 2
description = "Minimum number of instances for the ecs service. This will create an aws_appautoscaling_target that can later on be used to autoscale the MLflow instance"
}
variable "service_max_capacity" {
type = number
default = 2
description = "Maximum number of instances for the ecs service. This will create an aws_appautoscaling_target that can later on be used to autoscale the MLflow instance"
}
variable "service_linked_role_arn" {
type = string
default = null
description = "The ARN of the service-linked role that the ASG will use to call other AWS services. If left empty will use the default AWSServiceRoleForAutoScaling."
}
variable "service_use_nginx_basic_auth" {
type = bool
default = false
description = "If to use an nginx server ahead of Mlflow with basic auth."
}
variable "service_nginx_basic_auth_image" {
type = string
default = null
description = "Image to use for the nginx server."
}
variable "mlflow_env_vars" {
type = string
default = "{}"
description = "Mlflow environment variables to inject in the container"
}
variable "mlflow_generate_random_pass" {
type = bool
default = false
description = "If you want a random password to be generated for mlflow, or you'll inject one."
}
variable "mlflow_pass" {
type = string
default = "mlflow"
description = "Mlflow tracking password."
}
variable "database_use_external" {
type = bool
default = false
description = "If to create a database cluster or use an existing database."
}
variable "database_external_username" {
type = string
default = null
description = "ECS execution role ARN."
}
variable "database_external_host" {
type = string
default = null
description = "Database host, if using external."
}
variable "database_external_port" {
type = string
default = null
description = "Database port, if using external."
}
variable "database_external_name" {
type = string
default = null
description = "Database name, if using external."
}
variable "database_engine" {
type = string
default = "postgres"
description = "Database engine, default 'postgres'."
}
variable "database_engine_version" {
type = string
default = "12.5"
description = "Database version, default '12.5'."
}
variable "database_port" {
type = string
default = 5432
description = "Database port, default 5432 (Potgres)."
}
variable "database_subnet_ids" {
type = list(string)
default = null
description = "List of subnets where the RDS database will be deployed"
}
variable "database_password_secret_name" {
type = string
description = "The name of the SecretManager/ParameterStore secret that defines the database password. It needs to be created before calling the module"
}
variable "database_password_secret_is_parameter_store" {
type = bool
default = false
description = "Specifies if your database password secret is stored in the parameter store, by default false and we assume it is in the secrets manager"
}
variable "database_skip_final_snapshot" {
type = bool
default = false
}
variable "rds_instance_type" {
type = string
default = "db.t3.medium"
description = "RDS instance type for metadata."
}
variable "rds_allocated_storage" {
type = number
default = 10
description = "RDS intial allocated storage."
}
variable "rds_max_allocated_storage" {
type = number
default = 50
description = "RDS max allocated storage for storage autoscaling."
}
variable "backend_store_uri_engine" {
type = string
default = "postgresql+psycopg2"
description = "Mlflow backend store uri engine to use. Default: postgresql+psycopg2."
}
variable "artifact_bucket_id" {
type = string
default = null
description = "If specified, MLflow will use this bucket to store artifacts. Otherwise, this module will create a dedicated bucket. When overriding this value, you need to enable the task role to access the root you specified"
}
variable "artifact_bucket_path" {
type = string
default = "/"
description = "The path within the bucket where MLflow will store its artifacts"
}
variable "artifact_buckets_mlflow_will_read" {
description = "A list of bucket IDs MLflow will need read access to, in order to show the stored artifacts. It accepts any valid IAM resource, including ARNs with wildcards, so you can do something like arn:aws:s3:::bucket-prefix-*"
type = list(string)
default = []
}
variable "artifact_bucket_encryption_algorithm" {
description = "Algorithm used for encrypting the default bucket."
type = string
default = "AES256"
}
variable "artifact_bucket_encryption_key_arn" {
description = "ARN of the key used to encrypt the bucket. Only needed if you set aws:kms as encryption algorithm."
type = string
default = null
}
variable "gunicorn_opts" {
description = "Additional command line options forwarded to gunicorn processes (https://mlflow.org/docs/latest/cli.html#cmdoption-mlflow-server-gunicorn-opts)"
type = string
default = ""
}