-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathlambda.tf
More file actions
18 lines (15 loc) · 706 Bytes
/
lambda.tf
File metadata and controls
18 lines (15 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Defines the lambda function code that will be zipped
data "archive_file" "lambda" {
type = "zip"
source_file = "./files/${var.lambda_file_name}.mjs"
output_path = "./files/${var.lambda_file_name}.zip"
}
# Defines the lambda function to be created using file
resource "aws_lambda_function" "own_lambda" {
function_name = var.lambda_function_name
handler = "lambda_function.lambda_handler"
runtime = "nodejs22.x"
role = aws_iam_role.iam_for_lambda.arn
filename = data.archive_file.lambda.output_path # Adjust the path
source_code_hash = data.archive_file.lambda.output_base64sha256 # Adjust the path
}