-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda.tf
More file actions
24 lines (20 loc) · 819 Bytes
/
lambda.tf
File metadata and controls
24 lines (20 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Defines the lambda function code that will be zipped
data "archive_file" "lambda" {
type = "zip"
source_file = "./files/${var.lambda_file_name}.py"
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 = "python3.10"
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
environment {
variables = {
DESTINATION_SNS_ARN = aws_sns_topic.destination_sns_topic.arn
}
}
}