forked from hyprnz/terraform-aws-lambda-application-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vars.tf
533 lines (441 loc) · 15.1 KB
/
vars.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
variable "application_name" {
type = string
description = "Repo name of the lambda application."
}
variable "application_runtime" {
type = string
description = "Lambda runtime for the application."
}
variable "application_version" {
type = string
description = "Version of the function(s) deployed for the application."
}
variable "lambda_functions_config" {
type = map(any)
description = "Map of functions and associated configurations."
}
variable "lambda_alb_config" {
type = map(string)
description = "Contains entry point lambda function key"
default = {}
}
variable "internal_entrypoint_config" {
type = map(any)
description = "Map of configurations of internal entrypoints."
}
variable "alb_lambda_listener_arn" {
type = string
description = "Listener ARN of ALB"
default = ""
}
variable "msk_arn" {
type = string
description = "the MSK source arn for all lambda requires MSK"
default = ""
}
variable "msk_event_source_config" {
type = map(any)
description = "Map of configurations of MSK event source for each lambda"
default = {}
}
variable "artifact_bucket" {
type = string
description = "Bucket that stores function artifacts. Includes layer dependencies."
}
variable "artifact_bucket_key" {
type = string
description = "File name key of the artifact to load."
}
variable "application_env_vars" {
type = map(any)
description = "Map of environment variables required by any function in the application."
default = {}
}
variable "application_memory" {
type = number
description = "Memory allocated to all functions in the application. Defaults to `128`."
default = 128
}
variable "application_timeout" {
type = number
description = "Timeout in seconds for all functions in the application. Defaults to `3`."
default = 3
}
variable "vpc_subnet_ids" {
type = list(string)
description = "List of subnet IDs associated with the Lambda function"
default = []
}
variable "vpc_security_group_ids" {
type = list(string)
description = "List of security group IDs associated with the Lambda function"
default = []
}
variable "layer_artifact_key" {
type = string
description = "File name key of the layer artifact to load."
default = ""
}
variable "aws_cloudwatch_log_group_retention_in_days" {
type = number
description = "The retention period in days of all log group created for each function. Defaults to `30`."
default = 30
}
variable "enable_api_gateway" {
type = bool
description = "Allow to create api-gateway"
default = false
}
variable "zone_id" {
type = string
description = "Route 53 hosted zone id"
}
variable "domain_name" {
type = string
description = "The custom domain name for api gateway that points to lambda application"
}
variable "parameter_store_path" {
type = string
description = "SSM parameter path"
}
variable "ssm_kms_key_arn" {
type = string
description = "KMS key arn"
}
variable "alias_name" {
type = string
description = "Name of the alias being created"
}
variable "alias_description" {
type = string
description = "Name of the alias being created"
default = "Alias that points to the current lambda application version"
}
variable "custom_policy_document" {
type = string
description = "A valid policy json string that defines additional actions required by the execution role of the Lambda function"
default = ""
}
variable "custom_policy_description" {
type = string
description = "Allows to override the custom Lambda policy's description"
default = "The custom policy for the Lambda application module execution role"
}
variable "additional_layers" {
type = list(string)
description = "A list of layer ARN's (with or without aliases) to add to all functions within the Lambda application. Provides the ability to add dependencies for additional functionality such as monitoring and observability."
default = []
}
variable "tags" {
type = map(any)
description = "Additional tags that are added to all resources in this module."
default = {}
}
variable "service_target_group_name" {
type = string
description = "The service target group attached to application load balancer listener"
}
variable "service_target_group_path" {
type = string
description = "The target path attached to the service target group"
}
# datastore variables ==========================
variable "enable_datastore_module" {
type = bool
description = "Enables the data store module that will provision data storage resources"
default = true
}
variable "create_rds_instance" {
type = bool
description = "Controls if an RDS instance should be provisioned. Will take precedence if this and `use_rds_snapshot` are both true."
default = false
}
variable "use_rds_snapshot" {
type = bool
description = "Controls if an RDS snapshot should be used when creating the rds instance. Will use the latest snapshot of the `rds_identifier` variable."
default = false
}
variable "create_s3_bucket" {
type = bool
description = "Controls if an S3 bucket should be provisioned"
default = false
}
variable "create_dynamodb_table" {
type = bool
description = "Whether or not to enable DynamoDB resources"
default = false
}
variable "datastore_tags" {
type = map(string)
description = "Additional tags to add to all datastore resources"
default = {}
}
# RDS variables ================================
variable "rds_tags" {
type = map
description = "Additional tags for rds datastore resources"
default = {}
}
variable "rds_database_name" {
type = string
description = "The name of the database. Can only contain alphanumeric characters"
default = ""
}
variable "rds_identifier" {
type = string
description = "Identifier of datastore instance"
default = ""
}
variable "rds_apply_immediately" {
type = bool
description = "Specifies whether any database modifications are applied immediately, or during the next maintenance window. Defaults to `false`."
default = false
}
variable "rds_auto_minor_version_upgrade" {
type = bool
description = "Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Defaults to `true`."
default = true
}
variable "rds_engine" {
type = string
description = "The Database engine for the rds instance"
default = "postgres"
}
variable "rds_engine_version" {
type = string
description = "The version of the database engine."
default = "11"
}
variable "rds_instance_class" {
type = string
description = "The instance type to use"
default = "db.t3.small"
}
variable "rds_subnet_group" {
type = string
description = "Subnet group for RDS instances"
default = ""
}
variable "rds_security_group_ids" {
type = list(string)
description = "A List of security groups to bind to the rds instance"
default = []
}
variable "rds_allocated_storage" {
type = number
description = "Amount of storage allocated to RDS instance"
default = 100
}
variable "rds_max_allocated_storage" {
type = number
description = "The upper limit to which Amazon RDS can automatically scale the storage of the DB instance. Configuring this will automatically ignore differences to `allocated_storage`. Must be greater than or equal to `allocated_storage` or `0` to disable Storage Autoscaling."
default = 200
}
variable "rds_iops" {
type = number
description = "The amount of provisioned IOPS. Setting this implies a storage_type of 'io1'"
default = 0
}
variable "backup_retention_period" {
type = number
description = "The backup retention period in days"
default = 7
}
variable "rds_option_group_name" {
type = string
description = "Name of the DB option group to associate"
default = null
}
variable "rds_multi_az" {
type = bool
description = "Specifies if the RDS instance is multi-AZ."
default = false
}
variable "rds_monitoring_interval" {
type = number
description = "The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60."
default = 0
}
variable "rds_monitoring_role_arn" {
type = string
description = "The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. Must be specified if monitoring_interval is non-zero."
default = ""
}
variable "rds_enable_performance_insights" {
type = bool
description = "Controls the enabling of RDS Performance insights. Default to `true`"
default = true
}
variable "rds_backup_window" {
type = string
description = "The daily time range (in UTC) during which automated backups are created if they are enabled. Example: '09:46-10:16'. Must not overlap with maintenance_window"
default = "16:19-16:49"
}
variable "rds_skip_final_snapshot" {
type = bool
description = "Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted, using the value from final_snapshot_identifier"
default = true
}
variable "rds_final_snapshot_identifier" {
type = string
description = "The name of your final DB snapshot when this DB instance is deleted. Must be provided if `rds_skip_final_snapshot` is set to false. The value must begin with a letter, only contain alphanumeric characters and hyphens, and not end with a hyphen or contain two consecutive hyphens."
default = null
}
variable "rds_enable_storage_encryption" {
type = bool
description = "Specifies whether the DB instance is encrypted"
default = false
}
variable "rds_storage_encryption_kms_key_arn" {
type = string
description = "The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. If storage_encrypted is set to true and kms_key_id is not specified the default KMS key created in your account will be used"
default = ""
}
variable "rds_username" {
type = string
description = "RDS database user name"
default = ""
}
variable "rds_password" {
type = string
description = "RDS database password for the user"
default = ""
}
variable "rds_enable_deletion_protection" {
type = bool
description = " If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`."
default = false
}
// s3 variables =================================
variable "s3_tags" {
type = map
description = "Additional tags to be added to the s3 resources"
default = {}
}
variable "s3_bucket_name" {
type = string
description = "The name of the bucket. It is recommended to add a namespace/suffix to the name to avoid naming collisions"
default = ""
}
variable "s3_enable_versioning" {
type = bool
description = "If versioning should be configured on the bucket"
default = true
}
# Dynamodb variables ===========================
variable "dynamodb_tags" {
type = map
description = "Additional tags (e.g map(`BusinessUnit`,`XYX`)"
default = {}
}
variable "dynamodb_table_name" {
type = string
description = "DynamoDB table name. Must be supplied if creating a dynamodb table"
default = ""
}
variable "dynamodb_billing_mode" {
type = string
description = "DynamoDB Billing mode. Can be PROVISIONED or PAY_PER_REQUEST"
default = "PROVISIONED"
}
variable "dynamodb_enable_streams" {
type = bool
description = "Enable DynamoDB streams"
default = false
}
variable "dynamodb_stream_view_type" {
type = string
description = "When an item in a table is modified, what information is written to the stream"
#Valid values are `KEYS_ONLY`, `NEW_IMAGE`, `OLD_IMAGE` or `NEW_AND_OLD_IMAGES`
default = ""
}
variable "dynamodb_enable_encryption" {
type = bool
description = "Enable DynamoDB server-side encryption"
default = true
}
variable "dynamodb_enable_point_in_time_recovery" {
type = bool
description = "Enable DynamoDB point in time recovery"
default = true
}
variable "dynamodb_autoscale_read_target" {
type = number
description = "The target value (in %) for DynamoDB read autoscaling"
default = 50
}
variable "dynamodb_autoscale_write_target" {
type = number
description = "The target value (in %) for DynamoDB write autoscaling"
default = 50
}
variable "dynamodb_autoscale_min_read_capacity" {
type = number
description = "DynamoDB autoscaling min read capacity"
default = 5
}
variable "dynamodb_autoscale_min_write_capacity" {
type = number
description = "DynamoDB autoscaling min write capacity"
default = 5
}
variable "dynamodb_autoscale_max_read_capacity" {
type = number
description = "DynamoDB autoscaling max read capacity"
default = 20
}
variable "dynamodb_autoscale_max_write_capacity" {
type = number
description = "DynamoDB autoscaling max write capacity"
default = 20
}
variable "dynamodb_hash_key" {
type = string
description = "DynamoDB table Hash Key"
default = ""
}
variable "dynamodb_hash_key_type" {
type = string
description = "Hash Key type, which must be a scalar type: `S`, `N`, or `B` for (S)tring, (N)umber or (B)inary data"
default = "S"
}
variable "dynamodb_range_key" {
type = string
description = "DynamoDB table Range Key"
default = ""
}
variable "dynamodb_range_key_type" {
type = string
description = "Range Key type, which must be a scalar type: `S`, `N` or `B` for (S)tring, (N)umber or (B)inary data"
default = "S"
}
variable "dynamodb_ttl_enabled" {
type = bool
description = "Whether ttl is enabled or disabled"
default = true
}
variable "dynamodb_ttl_attribute" {
type = string
description = "DynamoDB table ttl attribute"
default = "Expires"
}
variable "dynamodb_attributes" {
type = list
description = "Additional DynamoDB attributes in the form of a list of mapped values"
default = []
}
variable "dynamodb_global_secondary_index_map" {
type = any
description = "Additional global secondary indexes in the form of a list of mapped values"
default = []
}
variable "dynamodb_local_secondary_index_map" {
type = list
description = "Additional local secondary indexes in the form of a list of mapped values"
default = []
}
variable "dynamodb_enable_autoscaler" {
type = bool
description = "Whether or not to enable DynamoDB autoscaling"
default = false
}