-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.tf
More file actions
35 lines (32 loc) · 935 Bytes
/
main.tf
File metadata and controls
35 lines (32 loc) · 935 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
29
30
31
32
33
34
35
/**
* #  Lambda Function
*
* [](https://github.com/figurate/terraform-aws-lambda-function/actions/workflows/main.yml)
*
*
* 
*
* Purpose: Provision a Lambda Function in AWS.
*
* Rationale: Apply standards provide templates for Lambda functions.
*/
data "aws_iam_role" "role" {
name = var.role
}
resource "aws_lambda_function" "function" {
function_name = var.function_name
role = data.aws_iam_role.role.arn
filename = var.filename
handler = var.handler
runtime = var.runtime
source_code_hash = var.source_code_hash
tracing_config {
mode = "Active"
}
dynamic "environment" {
for_each = length(var.environment) > 0 ? [1] : []
content {
variables = var.environment
}
}
}