-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.tf
More file actions
27 lines (22 loc) · 706 Bytes
/
Copy pathmain.tf
File metadata and controls
27 lines (22 loc) · 706 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
resource local_file config {
content = local.config_json
filename = "${path.module}/lambda/config.json"
}
data archive_file lambdazip {
depends_on = [local_file.config]
type = "zip"
output_path = "${path.module}/lambda_function.zip"
source_dir = "${path.module}/lambda"
}
resource aws_lambda_function lambda {
function_name = local.lambda_name
role = aws_iam_role.lambda.arn
publish = true
runtime = "nodejs12.x"
handler = "index.handler"
tags = local.tags
memory_size = 128
timeout = 5
filename = data.archive_file.lambdazip.output_path
source_code_hash = data.archive_file.lambdazip.output_base64sha256
}