-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
120 lines (101 loc) · 2.95 KB
/
variables.tf
File metadata and controls
120 lines (101 loc) · 2.95 KB
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
variable "source_dir" {
type = string
description = "Path to the source directory containing Lambda function code"
default = null
}
variable "handler" {
type = string
description = "Lambda function handler"
default = "bootstrap"
}
variable "runtime" {
type = string
description = "Lambda runtime"
default = "provided.al2023"
}
variable "architecture" {
type = string
description = "Lambda function architecture"
default = "arm64"
validation {
condition = contains(["x86_64", "arm64"], var.architecture)
error_message = "Architecture must be either x86_64 or arm64."
}
}
variable "memory_size" {
type = number
description = "Amount of memory in MB your Lambda Function can use at runtime"
default = 128
validation {
condition = var.memory_size >= 128 && var.memory_size <= 10240
error_message = "Memory size must be between 128 MB and 10,240 MB."
}
}
variable "timeout" {
type = number
description = "Amount of time your Lambda Function has to run in seconds"
default = 3
validation {
condition = var.timeout >= 1 && var.timeout <= 900
error_message = "Timeout must be between 1 and 900 seconds."
}
}
variable "environment_variables" {
type = map(string)
description = "Map of environment variables for the Lambda function"
default = {}
}
variable "log_retention_days" {
type = number
description = "CloudWatch log retention in days"
default = 14
validation {
condition = contains([
1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653
], var.log_retention_days)
error_message = "Log retention days must be a valid CloudWatch retention period."
}
}
variable "create_templates" {
type = bool
description = "Create template files (bootstrap, handler, Makefile) in template_dir"
default = false
}
variable "template_dir" {
type = string
description = "Directory to create template files in"
default = "./src"
}
variable "package_type" {
type = string
description = "Lambda deployment package type"
default = "Zip"
validation {
condition = contains(["Zip", "Image"], var.package_type)
error_message = "Package type must be either Zip or Image."
}
}
variable "image_uri" {
type = string
description = "ECR image URI for container image deployment"
default = null
}
variable "image_config" {
type = object({
entry_point = optional(list(string))
command = optional(list(string))
working_directory = optional(string)
})
description = "Container image configuration"
default = null
}
variable "filename" {
type = string
description = "Path to pre-built zip file (alternative to source_dir)"
default = null
}
variable "layers" {
type = list(string)
description = "List of Lambda layer ARNs to attach to the function"
default = []
}