-
Notifications
You must be signed in to change notification settings - Fork 1
/
operator_service_variables.tf
435 lines (365 loc) · 13.9 KB
/
operator_service_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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
/**
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
########################
# DO NOT EDIT MANUALLY #
########################
# This file is meant to be shared across all environments (either copied or
# symlinked). In order to make the upgrade process easier, this file should not
# be modified for environment-specific customization.
# Customization should occur either in a .tfvars file setting variable values or
# in a separate .tf file.
variable "region" {
type = string
description = "Region to deploy services to. Used for resource names."
}
variable "environment" {
type = string
description = "Name of the deployment environment (e.g. 'staging' or 'prod'). Used for resource names"
}
variable "worker_ssh_public_key" {
description = "RSA public key to be used for SSH access to worker EC2 instance."
type = string
default = ""
}
variable "instance_type" {
type = string
description = "EC2 instance type to use for aggregation workers."
default = "m5.xlarge" # 4 cores, 16GiB
}
variable "enclave_cpu_count" {
description = "Number of CPUs to allocate to the enclave."
type = number
default = 2 # Leave 2 vCPUs to host OS (minimum required). Depends on instance_type selected.
}
variable "enclave_memory_mib" {
description = "Memory (in mebibytes) to allocate to the enclave."
type = number
default = 13312 # 13 GiB. ~15GiB are available on m5.xlarge, leave 2GiB for host OS. Depends on instance_type selected.
}
variable "ami_name" {
type = string
description = "Name of the AMI to deploy as aggregation workers."
}
variable "ami_owners" {
type = list(string)
# See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami#owners
description = "Owners used to search for $ami_name."
default = ["self"]
}
variable "change_handler_lambda" {
description = <<-EOT
Change handler lambda path. If not provided defaults to tar location jar file.
Build with `cd operator/terraform/aws/jars/ && ./build_local_jars.sh`.
EOT
type = string
default = "../../jars/AwsChangeHandlerLambda_deploy.jar"
}
variable "frontend_lambda" {
description = <<-EOT
Frontend lambda path. If not provided defaults to tar location jar file.
Build with `cd operator/terraform/aws/jars/ && ./build_local_jars.sh`.
EOT
type = string
default = "../../jars/AwsApigatewayFrontend_deploy.jar"
}
variable "sqs_write_failure_cleanup_lambda" {
description = <<-EOT
SQS write failure cleanup lambda path. If not provided defaults to tar location jar file.
Build with `cd operator/terraform/aws/jars/ && ./build_local_jars.sh`.
EOT
type = string
default = "../../jars/AwsFrontendCleanupLambda_deploy.jar"
}
# Deprecated and replaced by "coordinator_a_assume_role_parameter", used only for
# backwards compatibility
variable "assume_role_parameter" {
type = string
description = "ARN of the role that the aggregation workers should assume."
# TODO: Remove after migration to updated client.
default = ""
}
variable "coordinator_a_assume_role_parameter" {
type = string
description = "ARN of the role that the aggregation workers should assume to access coordinator A."
# TODO: Remove after migration to updated client.
default = ""
}
variable "coordinator_b_assume_role_parameter" {
type = string
description = "ARN of the role that the aggregation workers should assume to access coordinator B."
default = ""
}
variable "kms_key_parameter" {
type = string
description = "ARN of the AWS KMS key used for encryption/decryption for testing outside of enclave."
default = "arn:aws:kms::example:key"
}
variable "initial_capacity_ec2_instances" {
default = 2
type = number
description = "configuration for the aggregation worker autoscaling process."
}
variable "min_capacity_ec2_instances" {
default = 1
type = number
description = "configuration for the aggregation worker autoscaling process."
}
variable "max_capacity_ec2_instances" {
type = number
description = "configuration for the aggregation worker autoscaling process."
default = 20
}
variable "max_job_num_attempts_parameter" {
type = string
default = "5"
description = "Max number of times a job can be picked up by a worker and attempted processing"
}
variable "max_job_processing_time_parameter" {
type = string
default = "3600"
description = "Max job processing time in seconds (queue visibility time-out)"
}
variable "asg_capacity_handler_lambda" {
description = <<-EOT
ASG capacity handler lambda path. If not provided defaults to tar location jar file.
Build with `cd operator/terraform/aws/jars/ && ./build_local_jars.sh`.
EOT
type = string
default = "../../jars/AsgCapacityHandlerLambda_deploy.jar"
}
variable "terminated_instance_handler_lambda" {
description = <<-EOT
Terminated instance handler lambda path. If not provided defaults to tar location jar file.
Build with `cd operator/terraform/aws/jars/ && ./build_local_jars.sh`.
EOT
type = string
default = "../../jars/TerminatedInstanceHandlerLambda_deploy.jar"
}
################################################################################
# MetadataDB Variables
################################################################################
variable "metadatadb_read_capacity" {
type = number
description = "The read capacity units for the MetadataDB DynamoDB Table"
default = 5
}
variable "metadatadb_write_capacity" {
type = number
description = "The write capacity units for the MetadataDB DynamoDB Table"
default = 5
}
################################################################################
# Frontend Alarm Variables
################################################################################
variable "frontend_alarms_enabled" {
type = string
description = "Enable alarms for frontend"
default = true
}
variable "frontend_alarm_eval_period_sec" {
description = "Amount of time (in seconds) for alarm evaluation. Default 60s"
type = string
default = "60"
}
variable "frontend_lambda_error_threshold" {
description = "Error rate greater than this to send alarm. Must be in decimal form. Eg: 10% = 0.10. Default 0"
type = string
default = "0.0"
}
variable "frontend_lambda_max_throttles_threshold" {
description = "Lambda max throttles to send alarm. Default 10."
type = string
default = "10"
}
variable "frontend_lambda_max_duration_threshold" {
description = "Lambda max duration in ms to send alarm. Useful for timeouts. Default 9999ms since lambda time out is set to 10s"
type = string
default = "9999"
}
variable "frontend_api_max_latency_ms" {
description = "API Gateway max latency to send alarm. Measured in milliseconds. Default 5000ms"
type = string
default = "5000"
}
variable "frontend_5xx_threshold" {
description = "API Gateway 5xx error rate greater than this to send alarm. Must be in decimal form. Eg: 10% = 0.10. Default 0"
type = string
default = "0.0"
}
variable "frontend_4xx_threshold" {
description = "API Gateway 4xx error rate greater than this to send alarm. Must be in decimal form. Eg: 10% = 0.10. Default 0"
type = string
default = "0.0"
}
variable "change_handler_dlq_threshold" {
description = "Change handler dead letter queue messages received greater than this to send alarm. Must be in decimal form. Eg: 10% = 0.10. Default 0"
type = string
default = "0.0"
}
variable "change_handler_max_latency_ms" {
description = "Change handler max duration in ms to send alarm. Useful for timeouts. Default 9999ms since lambda time out is set to 10s"
type = string
default = "9999"
}
################################################################################
# Worker Alarm Shared Variables
################################################################################
variable "worker_alarms_enabled" {
type = string
description = "Enable alarms for worker (includes alarms for autoscaling/jobqueue/worker)"
default = true
}
variable "alarm_notification_email" {
description = "Email to send operator component alarm notifications"
type = string
default = "noreply@example.com"
}
################################################################################
# Autoscaling Alarm Variables
################################################################################
variable "asg_capacity_lambda_error_threshold" {
type = number
default = 0.0
description = "Error rate greater than this to send alarm."
}
variable "asg_capacity_lambda_duration_threshold" {
type = number
default = 15000
description = "Alarm duration threshold in msec for runs of the AsgCapacityHandler Lambda function."
}
variable "asg_capacity_alarm_eval_period_sec" {
description = "Amount of time (in seconds) for alarm evaluation. Default 300s"
type = string
default = "300"
}
variable "terminated_instance_lambda_error_threshold" {
type = number
default = 0.0
description = "Error rate greater than this to send alarm."
}
variable "terminated_instance_lambda_duration_threshold" {
type = number
default = 15000
description = "Alarm duration threshold in msec for runs of the TerminatedInstanceHandler Lambda function."
}
variable "terminated_instance_alarm_eval_period_sec" {
description = "Amount of time (in seconds) for alarm evaluation. Default 300s"
type = string
default = "300"
}
variable "asg_max_instances_alarm_ratio" {
type = number
description = "Ratio of the auto scaling group max instances that should alarm on."
default = 0.9
}
variable "autoscaling_alarm_eval_period_sec" {
description = "Amount of time (in seconds) for alarm evaluation. Default 60s"
type = string
default = "60"
}
################################################################################
# Worker Alarm Variables
################################################################################
variable "job_client_error_threshold" {
type = number
description = "Alarm threshold for job client errors."
default = 0
}
variable "job_validation_failure_threshold" {
type = number
description = "Alarm threshold for job validation failures."
default = 0
}
variable "worker_job_error_threshold" {
type = number
description = "Alarm threshold for worker job errors."
default = 0
}
variable "worker_alarm_eval_period_sec" {
description = "Amount of time (in seconds) for alarm evaluation. Default 300s"
type = string
default = "300"
}
variable "worker_alarm_metric_dimensions" {
description = "Metric dimensions for worker alarms"
type = list(string)
default = ["JobHandlingError"]
}
################################################################################
# Job Queue Alarm Variables
################################################################################
variable "job_queue_old_message_threshold_sec" {
type = number
description = "Alarm threshold for old job queue messages in seconds."
default = 3600 //one hour
}
variable "job_queue_alarm_eval_period_sec" {
description = "Amount of time (in seconds) for alarm evaluation. Default 300s"
type = string
default = "300"
}
################################################################################
# MetadataDB Alarm Variables
################################################################################
variable "metadatadb_alarm_eval_period_sec" {
type = string
description = "Amount of time (in seconds) for alarm evaluation. Default 60"
default = "60"
}
variable "metadatadb_read_capacity_usage_ratio_alarm_threshold" {
type = string
description = "Read capacity usage ratio greater than this to send alarm. Value should be decimal. Example: 0.9"
default = "0.9"
}
variable "metadatadb_write_capacity_usage_ratio_alarm_threshold" {
type = string
description = "Write capacity usage ratio greater than this to send alarm. Value should be decimal. Example: 0.9"
default = "0.9"
}
################################################################################
# VPC, subnets and security group variables
################################################################################
variable "enable_user_provided_vpc" {
description = "Allow providing existing vpc details as input."
type = bool
default = false
}
variable "user_provided_vpc_subnet_ids" {
description = "Customized VPC subnet ids for worker autoscaling group"
type = list(string)
default = []
}
variable "user_provided_vpc_security_group_ids" {
description = "Customized VPC security group ids for worker autoscaling group"
type = list(string)
default = []
}
variable "vpc_cidr" {
description = "VPC CIDR range for coordinator VPC."
type = string
default = "10.0.0.0/16"
}
variable "vpc_availability_zones" {
description = "Specify the letter identifiers of which availability zones to deploy resources, such as a, b or c."
type = set(string)
default = [
"a",
"b",
"c",
"d",
"e",
]
}