-
Notifications
You must be signed in to change notification settings - Fork 14
/
variables.tf
442 lines (372 loc) · 12.5 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
#Module : LABEL
#Description : Terraform label module variables
variable "name" {
type = string
default = ""
description = "Name (e.g. `app` or `cluster`)."
}
variable "repository" {
type = string
default = "https://github.com/clouddrove/terraform-aws-lambda"
description = "Terraform current module repo"
}
variable "environment" {
type = string
default = ""
description = "Environment (e.g. `prod`, `dev`, `staging`)."
}
variable "label_order" {
type = list(any)
default = ["name", "environment"]
description = "Label order, e.g. `name`,`application`."
}
variable "attributes" {
type = list(any)
default = []
description = "Additional attributes (e.g. `1`)."
}
variable "managedby" {
type = string
default = "hello@clouddrove.com"
description = "ManagedBy, eg 'CloudDrove'."
}
# Module : Lambda function
# Description : Terraform Lambda function module variables.
variable "enable" {
type = bool
default = true
description = "Whether to create lambda function."
}
variable "filename" {
type = string
default = null
description = "The path to the function's deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used."
}
variable "s3_bucket" {
type = string
default = null
description = "The S3 bucket location containing the function's deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function."
}
variable "s3_key" {
type = string
default = null
description = "The S3 key of an object containing the function's deployment package. Conflicts with filename."
}
variable "s3_object_version" {
type = string
default = null
description = "The object version containing the function's deployment package. Conflicts with filename. "
}
variable "handler" {
type = string
description = "The function entrypoint in your code."
}
variable "description" {
type = string
default = ""
description = "Description of what your Lambda Function does."
}
variable "layers" {
type = list(string)
default = null
description = "List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function."
}
variable "memory_size" {
type = number
default = 128
description = "Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128."
}
variable "timeout" {
type = number
default = 10
description = "The amount of time in seconds your Lambda Function will run. Defaults to 3."
}
variable "runtime" {
type = string
default = "python3.7"
description = "Runtimes."
}
variable "reserved_concurrent_executions" {
type = number
default = 90
description = "The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1."
}
variable "publish" {
type = bool
default = false
description = "Whether to publish creation/change as new Lambda Function Version. Defaults to false."
}
variable "cloudwatch_logs_kms_key_arn" {
type = string
default = null
description = "The arn for the KMS encryption key for cloudwatch log group"
}
variable "lambda_kms_key_arn" {
type = string
default = null
description = "The ARN for the KMS encryption key."
}
variable "layer_filenames" {
type = list(any)
default = []
description = "The path to the function's deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used."
}
variable "s3_buckets" {
type = list(any)
default = []
description = "The S3 bucket location containing the function's deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function."
}
variable "s3_keies" {
type = list(any)
default = []
description = "The S3 key of an object containing the function's deployment package. Conflicts with filename."
}
variable "s3_object_versions" {
type = list(any)
default = []
description = "The object version containing the function's deployment package. Conflicts with filename."
}
variable "layer_names" {
type = list(any)
default = []
description = "A unique name for your Lambda Layer."
}
variable "compatible_runtimes" {
type = list(any)
default = []
description = "A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified."
}
variable "descriptions" {
type = list(any)
default = []
description = "Description of what your Lambda Layer does."
}
variable "license_infos" {
type = list(any)
default = []
description = "License info for your Lambda Layer. See License Info."
}
variable "statement_ids" {
type = list(any)
default = []
description = "A unique statement identifier. By default generated by Terraform. "
}
variable "event_source_tokens" {
type = list(any)
default = []
description = "The Event Source Token to validate. Used with Alexa Skills."
}
variable "iam_actions" {
type = list(any)
default = ["logs:CreateLogStream", "logs:CreateLogGroup", "logs:PutLogEvents"]
description = "The actions for Iam Role Policy."
}
variable "actions" {
type = list(any)
default = []
description = "The AWS Lambda action you want to allow in this statement. (e.g. lambda:InvokeFunction)."
}
variable "principals" {
type = list(any)
default = []
description = "The principal who is getting this permission. e.g. s3.amazonaws.com, an AWS account ID, or any valid AWS service principal such as events.amazonaws.com or sns.amazonaws.com."
}
variable "source_arns" {
type = list(any)
default = []
description = "When granting Amazon S3 or CloudWatch Events permission to invoke your function, you should specify this field with the Amazon Resource Name (ARN) for the S3 Bucket or CloudWatch Events Rule as its value. This ensures that only events generated from the specified bucket or rule can invoke the function."
}
variable "qualifiers" {
type = list(any)
default = []
description = "Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN. e.g. arn:aws:lambda:aws-region:acct-id:function:function-name:2"
}
variable "source_accounts" {
type = list(any)
default = []
description = "This parameter is used for S3 and SES. The AWS account ID (without a hyphen) of the source owner."
}
variable "subnet_ids" {
type = list(any)
default = []
description = "Subnet ids for vpc config."
}
variable "security_group_ids" {
type = list(any)
default = []
description = "Security group ids for vpc config."
}
variable "variables" {
type = map(any)
default = {}
description = "A map that defines environment variables for the Lambda function."
}
variable "image_config_entry_point" {
type = list(string)
default = []
description = "The ENTRYPOINT for the docker image"
}
variable "image_config_command" {
type = list(string)
default = []
description = "The CMD for the docker image"
}
variable "image_config_working_directory" {
type = string
default = null
description = "The working directory for the docker image"
}
variable "enable_key_rotation" {
type = bool
default = true
description = "Specifies whether key rotation is enabled. Defaults to true(security best practice)"
}
variable "kms_key_deletion_window" {
type = number
default = 10
description = "KMS Key deletion window in days."
}
variable "enable_kms" {
type = bool
default = true
description = "Flag to control creation of kms key for lambda encryption"
}
variable "create_iam_role" {
type = bool
default = true
description = "Flag to control creation of iam role and its related resources."
}
variable "source_file" {
type = string
default = null
description = "Path of source file that is required to be converted in `.zip` file"
}
variable "enable_source_code_hash" {
type = bool
default = false
description = "Whether to ignore changes to the function's source code hash. Set to true if you manage infrastructure and code deployments separately."
}
variable "skip_destroy" {
type = bool
default = false
description = "Whether to retain the old version of a previously deployed Lambda Layer."
}
variable "compatible_architectures" {
type = list(string)
default = null
description = "List of Architectures lambda layer is compatible with. Currently x86_64 and arm64 can be specified."
}
variable "create_layers" {
type = bool
default = false
description = "Flag to control creation of lambda layers."
}
variable "snap_start" {
type = bool
default = false
description = "(Optional) Snap start settings for low-latency startups"
}
variable "dead_letter_target_arn" {
type = string
default = null
description = "The ARN of an SNS topic or SQS queue to notify when an invocation fails."
}
variable "tracing_mode" {
type = string
default = null
description = "Tracing mode of the Lambda Function. Valid value can be either PassThrough or Active."
}
variable "file_system_local_mount_path" {
type = string
default = null
description = "The path where the function can access the file system, starting with /mnt/."
}
variable "file_system_arn" {
type = string
default = null
description = "The Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system."
}
variable "ephemeral_storage_size" {
type = number
default = 512
description = "Amount of ephemeral storage (/tmp) in MB your Lambda Function can use at runtime. Valid value between 512 MB to 10,240 MB (10 GB)."
}
variable "code_signing_config_arn" {
type = string
default = null
description = "Amazon Resource Name (ARN) for a Code Signing Configuration"
}
variable "architectures" {
type = list(string)
default = null
description = "Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]."
}
variable "package_type" {
type = string
default = "Zip"
description = "The Lambda deployment package type. Valid options: Zip or Image"
}
variable "iam_role_arn" {
type = string
default = null
description = "Iam Role arn to be attached to lambda function."
}
variable "image_uri" {
type = string
default = null
description = "The ECR image URI containing the function's deployment package."
}
variable "principal_org_id" {
type = string
default = null
description = "The identifier for your organization in AWS Organizations. Use this to grant permissions to all the AWS accounts under this organization."
}
variable "cloudwatch_logs_retention_in_days" {
type = number
default = null
description = "Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653."
}
variable "existing_cloudwatch_log_group" {
type = bool
default = false
description = "Whether to use an existing CloudWatch log group or create new"
}
variable "existing_cloudwatch_log_group_name" {
type = string
default = null
description = "Name of existing cloudwatch log group."
}
variable "attach_cloudwatch_logs_policy" {
type = bool
default = true
description = "Controls whether CloudWatch Logs policy should be added to IAM role for Lambda Function"
}
variable "policy_path" {
type = string
default = null
description = "Path of policies to that should be added to IAM role for Lambda Function"
}
variable "assume_role_policy" {
type = string
description = "assume role policy document in JSON format"
default = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
EOF
}
variable "aws_iam_policy_path" {
type = string
default = "/"
description = "IAM policy path default value"
}