-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda.tf
More file actions
28 lines (24 loc) · 760 Bytes
/
lambda.tf
File metadata and controls
28 lines (24 loc) · 760 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
25
26
27
28
data "archive_file" "lambda_zip" {
type = "zip"
output_path = "${path.module}/lambda_package/${var.env}-lambda.zip"
source {
content = file("${path.module}/../lambda/lambda_function.py")
filename = "lambda_function.py"
}
}
resource "aws_lambda_function" "health_check" {
function_name = "${var.env}-health-check-function"
filename = data.archive_file.lambda_zip.output_path
handler = var.lambda_handler
runtime = var.lambda_runtime
role = aws_iam_role.lambda_role.arn
source_code_hash = data.archive_file.lambda_zip.output_base64sha256
environment {
variables = {
REQUESTS_TABLE = aws_dynamodb_table.requests.name
}
}
tags = {
Environment = var.env
}
}