-
-
Notifications
You must be signed in to change notification settings - Fork 325
/
variables.tf
executable file
·606 lines (509 loc) · 18.8 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
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
variable "region" {
type = string
description = "AWS region"
}
variable "description" {
type = string
default = ""
description = "Short description of the Environment"
}
variable "elastic_beanstalk_application_name" {
type = string
description = "Elastic Beanstalk application name"
}
variable "environment_type" {
type = string
default = "LoadBalanced"
description = "Environment type, e.g. 'LoadBalanced' or 'SingleInstance'. If setting to 'SingleInstance', `rolling_update_type` must be set to 'Time', `updating_min_in_service` must be set to 0, and `loadbalancer_subnets` will be unused (it applies to the ELB, which does not exist in SingleInstance environments)"
}
variable "loadbalancer_type" {
type = string
default = "classic"
description = "Load Balancer type, e.g. 'application' or 'classic'"
}
variable "loadbalancer_is_shared" {
type = bool
default = false
description = "Flag to create a shared application loadbalancer. Only when loadbalancer_type = \"application\" https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb-shared.html"
}
variable "shared_loadbalancer_arn" {
type = string
default = ""
description = "ARN of the shared application load balancer. Only when loadbalancer_type = \"application\"."
}
variable "loadbalancer_crosszone" {
type = bool
default = true
description = "Configure the classic load balancer to route traffic evenly across all instances in all Availability Zones rather than only within each zone."
}
variable "loadbalancer_connection_idle_timeout" {
type = number
default = 60
description = "Classic load balancer only: Number of seconds that the load balancer waits for any data to be sent or received over the connection. If no data has been sent or received after this time period elapses, the load balancer closes the connection."
}
variable "dns_zone_id" {
type = string
default = ""
description = "Route53 parent zone ID. The module will create sub-domain DNS record in the parent zone for the EB environment"
}
variable "dns_subdomain" {
type = string
default = ""
description = "The subdomain to create on Route53 for the EB environment. For the subdomain to be created, the `dns_zone_id` variable must be set as well"
}
variable "vpc_id" {
type = string
description = "ID of the VPC in which to provision the AWS resources"
}
variable "loadbalancer_subnets" {
type = list(string)
description = "List of subnets to place Elastic Load Balancer"
default = []
}
variable "application_subnets" {
type = list(string)
description = "List of subnets to place EC2 instances"
}
variable "availability_zone_selector" {
type = string
default = "Any 2"
description = "Availability Zone selector"
}
variable "instance_type" {
type = string
default = "t2.micro"
description = "Instances type"
}
variable "enable_spot_instances" {
type = bool
default = false
description = "Enable Spot Instance requests for your environment"
}
variable "spot_fleet_on_demand_base" {
type = number
default = 0
description = "The minimum number of On-Demand Instances that your Auto Scaling group provisions before considering Spot Instances as your environment scales up. This option is relevant only when enable_spot_instances is true."
}
variable "spot_fleet_on_demand_above_base_percentage" {
type = number
default = -1
description = "The percentage of On-Demand Instances as part of additional capacity that your Auto Scaling group provisions beyond the SpotOnDemandBase instances. This option is relevant only when enable_spot_instances is true."
}
variable "spot_max_price" {
type = number
default = -1
description = "The maximum price per unit hour, in US$, that you're willing to pay for a Spot Instance. This option is relevant only when enable_spot_instances is true. Valid values are between 0.001 and 20.0"
}
variable "enhanced_reporting_enabled" {
type = bool
default = true
description = "Whether to enable \"enhanced\" health reporting for this environment. If false, \"basic\" reporting is used. When you set this to false, you must also set `enable_managed_actions` to false"
}
variable "managed_actions_enabled" {
type = bool
default = true
description = "Enable managed platform updates. When you set this to true, you must also specify a `PreferredStartTime` and `UpdateLevel`"
}
variable "autoscale_min" {
type = number
default = 2
description = "Minumum instances to launch"
}
variable "autoscale_max" {
type = number
default = 3
description = "Maximum instances to launch"
}
variable "solution_stack_name" {
type = string
description = "Elastic Beanstalk stack, e.g. Docker, Go, Node, Java, IIS. For more info, see https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html"
}
variable "wait_for_ready_timeout" {
type = string
default = "20m"
description = "The maximum duration to wait for the Elastic Beanstalk Environment to be in a ready state before timing out"
}
variable "associate_public_ip_address" {
type = bool
default = false
description = "Whether to associate public IP addresses to the instances"
}
variable "tier" {
type = string
default = "WebServer"
description = "Elastic Beanstalk Environment tier, 'WebServer' or 'Worker'"
}
variable "version_label" {
type = string
default = ""
description = "Elastic Beanstalk Application version to deploy"
}
variable "force_destroy" {
type = bool
default = false
description = "Force destroy the S3 bucket for load balancer logs"
}
variable "rolling_update_enabled" {
type = bool
default = true
description = "Whether to enable rolling update"
}
variable "rolling_update_type" {
type = string
default = "Health"
description = "`Health` or `Immutable`. Set it to `Immutable` to apply the configuration change to a fresh group of instances"
}
variable "deployment_policy" {
type = string
default = "Rolling"
description = "Use the DeploymentPolicy option to set the deployment type. The following values are supported: `AllAtOnce`, `Rolling`, `RollingWithAdditionalBatch`, `Immutable`, `TrafficSplitting`"
}
variable "updating_min_in_service" {
type = number
default = 1
description = "Minimum number of instances in service during update"
}
variable "updating_max_batch" {
type = number
default = 1
description = "Maximum number of instances to update at once"
}
variable "health_streaming_enabled" {
type = bool
default = false
description = "For environments with enhanced health reporting enabled, whether to create a group in CloudWatch Logs for environment health and archive Elastic Beanstalk environment health data. For information about enabling enhanced health, see aws:elasticbeanstalk:healthreporting:system."
}
variable "health_streaming_delete_on_terminate" {
type = bool
default = false
description = "Whether to delete the log group when the environment is terminated. If false, the health data is kept RetentionInDays days."
}
variable "health_streaming_retention_in_days" {
type = number
default = 7
description = "The number of days to keep the archived health data before it expires."
}
variable "healthcheck_url" {
type = string
default = "/"
description = "Application Health Check URL. Elastic Beanstalk will call this URL to check the health of the application running on EC2 instances"
}
variable "enable_log_publication_control" {
type = bool
default = false
description = "Copy the log files for your application's Amazon EC2 instances to the Amazon S3 bucket associated with your application"
}
variable "enable_stream_logs" {
type = bool
default = false
description = "Whether to create groups in CloudWatch Logs for proxy and deployment logs, and stream logs from each instance in your environment"
}
variable "logs_delete_on_terminate" {
type = bool
default = false
description = "Whether to delete the log groups when the environment is terminated. If false, the logs are kept RetentionInDays days"
}
variable "enable_loadbalancer_logs" {
type = bool
default = true
description = "Whether to enable Load Balancer Logging to the S3 bucket."
}
variable "logs_retention_in_days" {
type = number
default = 7
description = "The number of days to keep log events before they expire."
}
variable "loadbalancer_certificate_arn" {
type = string
default = ""
description = "Load Balancer SSL certificate ARN. The certificate must be present in AWS Certificate Manager"
}
variable "loadbalancer_ssl_policy" {
type = string
default = ""
description = "Specify a security policy to apply to the listener. This option is only applicable to environments with an application load balancer"
}
variable "loadbalancer_security_groups" {
type = list(string)
default = []
description = "Load balancer security groups"
}
variable "loadbalancer_managed_security_group" {
type = string
default = ""
description = "Load balancer managed security group"
}
variable "http_listener_enabled" {
type = bool
default = true
description = "Enable port 80 (http)"
}
variable "application_port" {
type = number
default = 80
description = "Port application is listening on"
}
variable "preferred_start_time" {
type = string
default = "Sun:10:00"
description = "Configure a maintenance window for managed actions in UTC"
}
variable "update_level" {
type = string
default = "minor"
description = "The highest level of update to apply with managed platform updates"
}
variable "instance_refresh_enabled" {
type = bool
default = true
description = "Enable weekly instance replacement."
}
variable "keypair" {
type = string
description = "Name of SSH key that will be deployed on Elastic Beanstalk and DataPipeline instance. The key should be present in AWS"
default = ""
}
variable "root_volume_size" {
type = number
default = 8
description = "The size of the EBS root volume"
}
variable "root_volume_type" {
type = string
default = "gp2"
description = "The type of the EBS root volume"
}
variable "autoscale_measure_name" {
type = string
default = "CPUUtilization"
description = "Metric used for your Auto Scaling trigger"
}
variable "autoscale_statistic" {
type = string
default = "Average"
description = "Statistic the trigger should use, such as Average"
}
variable "autoscale_unit" {
type = string
default = "Percent"
description = "Unit for the trigger measurement, such as Bytes"
}
variable "autoscale_lower_bound" {
type = number
default = 20
description = "Minimum level of autoscale metric to remove an instance"
}
variable "autoscale_lower_increment" {
type = number
default = -1
description = "How many Amazon EC2 instances to remove when performing a scaling activity."
}
variable "autoscale_upper_bound" {
type = number
default = 80
description = "Maximum level of autoscale metric to add an instance"
}
variable "autoscale_upper_increment" {
type = number
default = 1
description = "How many Amazon EC2 instances to add when performing a scaling activity"
}
variable "elb_scheme" {
type = string
default = "public"
description = "Specify `internal` if you want to create an internal load balancer in your Amazon VPC so that your Elastic Beanstalk application cannot be accessed from outside your Amazon VPC"
}
variable "ssh_listener_enabled" {
type = bool
default = false
description = "Enable SSH port"
}
variable "ssh_listener_port" {
type = number
default = 22
description = "SSH port"
}
variable "additional_settings" {
type = list(object({
namespace = string
name = string
value = string
}))
default = []
description = "Additional Elastic Beanstalk setttings. For full list of options, see https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html"
}
variable "env_vars" {
type = map(string)
default = {}
description = "Map of custom ENV variables to be provided to the application running on Elastic Beanstalk, e.g. env_vars = { DB_USER = 'admin' DB_PASS = 'xxxxxx' }"
}
# From: http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region
# Via: https://github.com/hashicorp/terraform/issues/7071
variable "alb_zone_id" {
type = map(string)
default = {
ap-northeast-1 = "Z1R25G3KIG2GBW"
ap-northeast-2 = "Z3JE5OI70TWKCP"
ap-south-1 = "Z18NTBI3Y7N9TZ"
ap-southeast-1 = "Z16FZ9L249IFLT"
ap-southeast-2 = "Z2PCDNR3VC2G1N"
ca-central-1 = "ZJFCZL7SSZB5I"
eu-central-1 = "Z1FRNW7UH4DEZJ"
eu-west-1 = "Z2NYPWQ7DFZAZH"
eu-west-2 = "Z1GKAAAUGATPF1"
sa-east-1 = "Z10X7K2B4QSOFV"
us-east-1 = "Z117KPS5GTRQ2G"
us-east-2 = "Z14LCN19Q5QHIC"
us-west-1 = "Z1LQECGX5PH1X"
us-west-2 = "Z38NKT9BP95V3O"
eu-west-3 = "Z3Q77PNBQS71R4"
af-south-1 = "Z1EI3BVKMKK4AM"
ap-east-1 = "ZPWYUBWRU171A"
eu-central-1 = "Z1FRNW7UH4DEZJ"
eu-south-1 = "Z10VDYYOA2JFKM"
eu-north-1 = "Z23GO28BZ5AETM"
me-south-1 = "Z2BBTEKR2I36N2"
sa-east-1 = "Z10X7K2B4QSOFV"
us-gov-west-1 = "Z31GFT0UA1I2HV"
us-gov-east-1 = "Z2NIFVYYW2VKV1"
}
description = "ALB zone id"
}
variable "ami_id" {
type = string
default = null
description = "The id of the AMI to associate with the Amazon EC2 instances"
}
variable "deployment_batch_size_type" {
type = string
default = "Fixed"
description = "The type of number that is specified in deployment_batch_size_type"
}
variable "deployment_batch_size" {
type = number
default = 1
description = "Percentage or fixed number of Amazon EC2 instances in the Auto Scaling group on which to simultaneously perform deployments. Valid values vary per deployment_batch_size_type setting"
}
variable "deployment_ignore_health_check" {
type = bool
default = false
description = "Do not cancel a deployment due to failed health checks"
}
variable "deployment_timeout" {
type = number
default = 600
description = "Number of seconds to wait for an instance to complete executing commands"
}
variable "extended_ec2_policy_document" {
type = string
default = ""
description = "Extensions or overrides for the IAM role assigned to EC2 instances"
}
variable "prefer_legacy_ssm_policy" {
type = bool
default = true
description = "Whether to use AmazonEC2RoleforSSM (will soon be deprecated) or AmazonSSMManagedInstanceCore policy"
}
variable "prefer_legacy_service_policy" {
type = bool
default = true
description = "Whether to use AWSElasticBeanstalkService (deprecated) or AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy policy"
}
variable "s3_bucket_access_log_bucket_name" {
type = string
default = ""
description = "Name of the S3 bucket where s3 access log will be sent to"
}
variable "s3_bucket_versioning_enabled" {
type = bool
default = true
description = "When set to 'true' the s3 origin bucket will have versioning enabled"
}
variable "scheduled_actions" {
type = list(object({
name = string
minsize = string
maxsize = string
desiredcapacity = string
starttime = string
endtime = string
recurrence = string
suspend = bool
}))
default = []
description = "Define a list of scheduled actions"
}
variable "healthcheck_interval" {
type = number
default = 10
description = "The interval of time, in seconds, that Elastic Load Balancing checks the health of the Amazon EC2 instances of your application"
}
variable "healthcheck_timeout" {
type = number
default = 5
description = "The amount of time, in seconds, to wait for a response during a health check. Note that this option is only applicable to environments with an application load balancer"
}
variable "healthcheck_healthy_threshold_count" {
type = number
default = 3
description = "The number of consecutive successful requests before Elastic Load Balancing changes the instance health status"
}
variable "healthcheck_unhealthy_threshold_count" {
type = number
default = 3
description = "The number of consecutive unsuccessful requests before Elastic Load Balancing changes the instance health status"
}
variable "healthcheck_httpcodes_to_match" {
type = list(string)
default = ["200"]
description = "List of HTTP codes that indicate that an instance is healthy. Note that this option is only applicable to environments with a network or application load balancer"
}
variable "root_volume_iops" {
type = number
default = null
description = "The IOPS of the EBS root volume (only applies for gp3 and io1 types)"
}
variable "root_volume_throughput" {
type = number
default = null
description = "The type of the EBS root volume (only applies for gp3 type)"
}
variable "enable_capacity_rebalancing" {
type = bool
default = false
description = "Specifies whether to enable the Capacity Rebalancing feature for Spot Instances in your Auto Scaling Group"
}
variable "loadbalancer_redirect_http_to_https" {
type = bool
default = false
description = "Redirect HTTP traffic to HTTPS listener"
}
variable "loadbalancer_redirect_http_to_https_priority" {
type = number
default = 1
description = "Defines the priority for the HTTP to HTTPS redirection rule"
}
variable "loadbalancer_redirect_http_to_https_path_pattern" {
type = list(string)
default = ["*"]
description = "Defines the path pattern for the HTTP to HTTPS redirection rule"
}
variable "loadbalancer_redirect_http_to_https_host" {
type = string
default = "#{host}"
description = "Defines the host for the HTTP to HTTPS redirection rule"
}
variable "loadbalancer_redirect_http_to_https_port" {
type = string
default = "443"
description = "Defines the port for the HTTP to HTTPS redirection rule"
}
variable "loadbalancer_redirect_http_to_https_status_code" {
type = string
default = "HTTP_301"
description = "The redirect status code"
validation {
condition = contains(["HTTP_301", "HTTP_302"], var.loadbalancer_redirect_http_to_https_status_code)
error_message = "Allowed values are \"HTTP_301\" or \"HTTP_302\"."
}
}