forked from TailorDev/hello-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
29 lines (24 loc) · 809 Bytes
/
main.tf
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
29
variable "name" {
description = "The name of the lambda to create, which also defines (i) the archive name (.zip), (ii) the file name, and (iii) the function name"
}
variable "runtime" {
description = "The runtime of the lambda to create"
default = "nodejs"
}
variable "handler" {
description = "The handler name of the lambda (a function defined in your lambda)"
default = "handler"
}
variable "role" {
description = "IAM role attached to the Lambda Function (ARN)"
}
resource "aws_lambda_function" "lambda" {
filename = "${var.name}.zip"
function_name = "${var.name}_${var.handler}"
role = "${var.role}"
handler = "${var.name}.${var.handler}"
runtime = "${var.runtime}"
}
output "name" {
value = "${aws_lambda_function.lambda.function_name}"
}