Skip to content

Commit 22d9a21

Browse files
committed
feat(lambda): parameterize Lambda runtime
Make Lambda runtime configurable by replacing hardcoded "python3.10" with a variable. This allows users to specify different Python versions or other runtimes as needed, while maintaining backward compatibility through the default value of "python3.10"
1 parent bd53466 commit 22d9a21

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ resource "aws_lambda_function" "this" {
264264
function_name = var.name
265265
role = var.custom_iam_role_arn == null ? aws_iam_role.this[0].arn : var.custom_iam_role_arn
266266
handler = "scheduler.main.lambda_handler"
267-
runtime = "python3.10"
267+
runtime = var.runtime
268268
timeout = "600"
269269
kms_key_arn = var.kms_key_arn == null ? "" : var.kms_key_arn
270270

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ variable "aws_regions" {
3232
default = null
3333
}
3434

35+
variable "runtime" {
36+
description = "The runtime environment for the Lambda function that you are uploading. For example, python3.8"
37+
type = string
38+
default = "python3.10"
39+
}
40+
3541
variable "schedule_action" {
3642
description = "Define schedule action to apply on resources, accepted value are 'stop or 'start"
3743
type = string

0 commit comments

Comments
 (0)