-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
315 lines (266 loc) · 6.79 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 "region" {
description = "The AWS region to deploy resources in"
type = string
#default = "us-east-1" # Optional default value
}
variable "vpc_cidr_block" {
description = "The CIDR block for the VPC"
type = string
default = "10.0.0.0/16"
}
variable "public_subnet_cidrs" {
type = list(string)
description = "Public Subnet CIDR values"
default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
}
variable "private_subnet_cidrs" {
type = list(string)
description = "Private Subnet CIDR values"
default = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
}
variable "azs" {
type = list(string)
description = "Availability Zones"
default = ["us-east-1d", "us-east-1e", "us-east-1f"]
}
variable "ami_id" {
description = "The ID of the custom AMI to use for the EC2 instance"
type = string
}
variable "instance_type" {
description = "The EC2 instance type"
type = string
default = "t2.micro" # Default instance type if none is provided
}
variable "application_port" {
description = "Port on which the application runs"
type = number
}
variable "root_volume_size" {
description = "Size of the root volume in GB"
type = number
default = 25 # Default size is 25GB if none is provided
}
variable "jdbc_prefix" {
description = "The JDBC prefix for the database connection"
type = string
default = "jdbc:postgresql" # Default JDBC prefix
}
variable "db_user" {
default = "postgres"
}
variable "db_pass" {
default = "Northeastern2024"
}
variable "db_name" {
default = "webapp"
}
variable "db_port" {
type = number
default = 5432
}
variable "db_identifier" {
description = "The identifier for the RDS instance"
type = string
default = "csye6225" # Default value, can be overridden
}
variable "db_engine" {
description = "The database engine for the RDS instance"
type = string
default = "postgres" # Default database engine
}
variable "db_engine_version" {
description = "The version of the database engine"
type = string
default = "16.3" # Default version
}
variable "instance_class" {
description = "The instance class for the RDS instance"
type = string
default = "db.t3.micro" # Default instance type
}
variable "allocated_storage" {
description = "The allocated storage in GB for the RDS instance"
type = number
default = 20 # Default storage
}
variable "skip_final_snapshot" {
description = "Skip final snapshot when deleting the RDS instance"
type = bool
default = true # Default value, can be overridden
}
variable "publicly_accessible" {
description = "Allow public access to the RDS instance"
type = bool
default = false # Default value, can be overridden
}
variable "multi_az" {
description = "Enable Multi-AZ for the RDS instance"
type = bool
default = false # Default value, can be overridden
}
variable "db_parameter_group_name" {
description = "The name of the RDS parameter group"
type = string
default = "csye6225-db-parameter-group" # Default value, can be overridden
}
variable "db_parameter_group_family" {
description = "The family of the RDS parameter group"
type = string
default = "postgres16" # Default value, can be overridden
}
# Spring Boot-specific environment variables
variable "banner_mode" {
default = "off"
}
variable "application_name" {
default = "webapp"
}
variable "show_sql" {
default = "true"
}
variable "non_contextual_creation" {
default = "true"
}
variable "hibernate_dialect" {
default = "org.hibernate.dialect.PostgreSQLDialect"
}
variable "hibernate_ddl_auto" {
default = "update"
}
variable "volume_type" {
default = "gp2"
}
variable "delete_on_termination" {
default = "true"
}
# Define variables if not already defined
variable "domain_name" {
description = "The domain name for the application"
type = string
}
variable "subdomain" {
description = "The subdomain to be created"
type = string
default = "dev"
}
variable "route53_zone_id" {
description = "The Route 53 hosted zone ID"
type = string
}
variable "record_type" {
type = string
default = "A"
}
variable "record_ttl" {
type = number
default = 60
}
variable "s3_bucket_server_side_encryption_algorithm_name" {
type = string
default = "AES256"
}
# AWS Profile Name
variable "aws_profile_name" {
description = "The AWS profile to use, defaulting to 'dev'"
type = string
default = "dev"
}
# Maximum File Size for Multipart Uploads
variable "max_file_size" {
description = "The maximum file size for file uploads, defaulting to 1MB"
type = string
default = "1MB"
}
# Maximum Request Size for Multipart Requests
variable "max_request_size" {
description = "The maximum request size for multipart requests, defaulting to 1MB"
type = string
default = "1MB"
}
variable "key_name" {
description = "The name of the SSH key pair to use for SSH access to the instances"
type = string
default = "ec2"
}
variable "desired_capacity" {
default = 3
}
variable "max_size" {
default = 5
}
variable "min_size" {
default = 3
}
variable "health_check_type" {
default = "ELB"
}
variable "cpu_high_threshold" {
default = 12
}
variable "cpu_low_threshold" {
default = 8
}
variable "scale_up_adjustment" {
default = 1
}
variable "scale_down_adjustment" {
default = -1
}
variable "cooldown" {
default = 60
}
variable "environment" {
default = "Production"
}
variable "asg_name" {
default = "CSYE6225-ASG"
}
variable "instance_name" {
default = "CSYE6225-EC2"
}
variable "mailgun_api_url" {
type = string
}
variable "mailgun_api_key" {
type = string
}
variable "from_email" {
type = string
}
variable "verification_link" {
type = string
}
#variable "domain_url" {
#type = string
#}
variable "launch_template_name" {
description = "This launch template name is passed in the packer file using github secrets"
type = string
default = "csye6225-launch-template"
}
variable "autoscaling_group_name" {
description = "This auto scaling group name is passed in the packer file using github secrets"
type = string
default = "csye6225-autoscaling-group"
}
variable "kms_key_rotation_period" {
description = "Rotation period for KMS key in days"
default = 90
}
variable "deletion_window_in_days" {
description = "Deletion period for KMS key in days"
default = 30
}
variable "email_secret_name_mailgun" {
type = string
default = "email-credentials"
}
variable "lambda_function_timeout" {
description = "lambda function timeout in seconds"
default = 30
}
variable "lambda_function_memory_size" {
description = "lambda function memory size"
default = 400
}