-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
315 lines (264 loc) · 9.34 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
variable "retool_licence" {
description = "Retool license for self-hosting."
type = string
default = ""
}
locals {
stack_name = "${var.stack_name}-${random_id.stack_name_random.hex}"
database_name = var.database_name
retool_image = "tryretool/backend:${var.retool_release_version}"
retool_alb_ingress_port = var.alb_listener_certificate_arn != null ? "443" : var.retool_alb_ingress_port
retool_alb_listener_protocol = var.alb_listener_certificate_arn != null ? "HTTPS" : var.aws_lb_listener_protocol
retool_alb_listener_ssl_policy = var.alb_listener_certificate_arn != null ? var.alb_listener_ssl_policy : null
retool_alb_listener_certificate_arn = var.alb_listener_certificate_arn
retool_url_port = local.retool_alb_ingress_port != "443" ? ":${local.retool_alb_ingress_port}" : ""
retool_jwt_secret = {
password = random_password.retool_jwt_secret.result
}
retool_encryption_key_secret = {
password = random_password.retool_encryption_key_secret.result
}
retool_rds_secret = {
username = "retool"
password = random_password.retool_rds_secret.result
}
}
variable "aws_region" {
description = "AWS Region to deploy resources"
type = string
default = "us-east-1"
}
variable "stack_name" {
description = "Base Retool stack name"
type = string
default = "retool-self-hosted"
}
variable "database_name" {
description = "Retool postgresql database name"
type = string
default = "hammerhead_production"
}
variable "postgresql_ssl_enabled" {
description = "Enable or disable postgresql SSL"
type = bool
default = true
}
variable "postgresql_db_port" {
description = "Postgresql RDS listening port"
type = number
default = "5432"
}
variable "retool_release_version" {
description = "Official Retool release version found: https://github.com/tryretool/retool-onpremise#select-a-retool-version-number"
type = string
default = "3.22.1"
}
variable "retool_alb_sg_ingress_cidr_blocks" {
description = "Cidr block allowed to ingress the Retool ALB"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "retool_alb_sg_egress_cidr_blocks" {
description = "Cidr block allowed to egress the Retool ALB"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "retool_rds_sg_ingress_cidr_blocks" {
description = "Cidr block allowed to ingress the Retool RDS DB"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "retool_rds_sg_egress_cidr_blocks" {
description = "Cidr block allowed to egress the Retool RDS DB"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "retool_task_network_mode" {
description = "The Docker networking mode to use for the containers in the task"
type = string
default = "awsvpc"
}
variable "retool_task_cpu" {
description = "The hard limit of CPU units to present for the task. It can be expressed as an integer using CPU units (for example, 1024)"
type = number
default = "1024"
}
variable "retool_task_memory" {
description = "The hard limit of memory (in MiB) to present to the task. It can be expressed as an integer using MiB (for example 2048)"
type = number
default = "2048"
}
variable "retool_task_container_node_env" {
description = "Set Retool task container environment"
type = string
default = "production"
}
variable "retool_task_container_service_type" {
description = "Retool task container service type"
type = string
default = "MAIN_BACKEND,DB_CONNECTOR"
}
variable "retool_task_container_force_deployment" {
description = "Set if Terraform should force deploy regardless if change has been detected"
type = bool
default = false
}
variable "retool_task_container_cookie_insecure" {
description = "Allow cookies to be insecure e.g. not using Retool over https"
type = bool
default = true
}
variable "retool_task_container_name" {
description = "Name of Retool task"
type = string
default = "retool"
}
variable "retool_task_container_port" {
description = "Retool task listening port"
type = number
default = "3000"
}
variable "retool_jobs_runner_task_network_mode" {
description = "The Docker networking mode to use for the containers in the task"
type = string
default = "awsvpc"
}
variable "retool_jobs_runner_task_cpu" {
description = "The hard limit of CPU units to present for the task. It can be expressed as an integer using CPU units (for example, 1024)"
type = number
default = "1024"
}
variable "retool_jobs_runner_task_memory" {
description = "The hard limit of memory (in MiB) to present to the task. It can be expressed as an integer using MiB (for example 2048)"
type = number
default = "2048"
}
variable "retool_jobs_runner_task_container_node_env" {
description = "Set Retool jobs runner task container environment"
type = string
default = "production"
}
variable "retool_jobs_runner_task_container_service_type" {
description = "Retool jobs runner task container service type"
type = string
default = "JOBS_RUNNER"
}
variable "retool_jobs_runner_task_container_force_deployment" {
description = "Set if Terraform should force deploy regardless if change has been detected"
type = bool
default = false
}
variable "retool_jobs_runner_task_container_cookie_insecure" {
description = "Allow cookies to be insecure e.g. not using Retool over https"
type = bool
default = true
}
variable "retool_jobs_runner_task_container_name" {
description = "Name of Retool jobs runner task"
type = string
default = "retool-jobs-runner"
}
variable "retool_ecs_tasks_logdriver" {
description = "Send log information to CloudWatch Logs"
type = string
default = "awslogs"
}
variable "retool_ecs_tasks_log_prefix" {
description = "Associate a log stream with the specified prefix, the container name, and the ID of the Amazon ECS task that the container belongs to"
type = string
default = "SERVICE_RETOOL"
}
variable "retool_alb_ingress_port" {
description = "Retool ALB ingress port"
type = number
default = "3000"
}
variable "retool_rds_cluster_engine" {
description = "AWS RDS Cluster engine flavor"
type = string
default = "aurora-postgresql"
}
variable "retool_rds_cluster_engine_version" {
description = "AWS RDS Cluster engine version - this is despendent on var.retool_rds_cluster_engine"
type = number
default = "12.16"
}
variable "retool_rds_cluster_instance_count" {
description = "Retool RDS Cluster Instance count"
type = number
default = "2"
}
variable "retool_rds_cluster_instance_class" {
description = "Retool RDS RDS Cluster Instance flavor"
type = string
default = "db.r4.large"
}
variable "vpc_id" {
description = "AWS VPC for Fargate and ALB to utilize"
type = string
}
variable "availability_zones" {
description = "AWS VPC for Fargate and ALB to utilize"
type = list(string)
}
variable "retool_alb_subnets" {
description = "AWS VPC for Fargate and ALB to utilize"
type = list(string)
}
variable "retool_jobs_runner_ecs_service_subnet" {
description = "AWS VPC for Fargate and ALB to utilize"
type = list(string)
}
variable "retool_ecs_service_subnet" {
description = "AWS VPC for Fargate and ALB to utilize"
type = list(string)
}
variable "retool_db_subnet_ids" {
description = "AWS VPC for Fargate and ALB to utilize"
type = list(string)
}
variable "aws_lb_listener_protocol" {
description = "AWS ALB listening protocol e.g HTTP, HTTPS etc"
type = string
default = "HTTP"
}
variable "aws_alb_target_group_protocol" {
description = "Protocol ALB should use to talk with target group e.g HTTP, HTTPS etc"
type = string
default = "HTTP"
}
variable "retool_ecs_service_deploy_max" {
description = "Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment"
type = number
default = "250"
}
variable "retool_ecs_service_deploy_min_health" {
description = "Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment"
type = number
default = "50"
}
variable "retool_ecs_service_count" {
description = "Number of instances of the task definition to place and keep running"
type = number
default = "2"
}
variable "retool_custom_host_url" {
description = "Specify a custom hostname that will be used to create a custom url instead of the Load Balancer address. e.g. retool"
type = string
default = null
}
variable "route_53_zone_id" {
description = "AWS Route53 zone_id to create retool_custom_url record in"
type = string
default = null
}
variable "alb_listener_certificate_arn" {
description = "Certificate Manager ARN use in ALB listener"
type = string
default = null
}
variable "alb_listener_ssl_policy" {
description = "retool_alb_listener_ssl_policy"
type = string
default = "ELBSecurityPolicy-2016-08"
}