forked from Liron-Refaeli/code2cloud-python-flask-webserver
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathlambda.tf
More file actions
66 lines (56 loc) · 2.3 KB
/
lambda.tf
File metadata and controls
66 lines (56 loc) · 2.3 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# lambda.tf
# Defines a map of common settings to be reused by all Lambda functions in this file.
locals {
common_lambda_settings = {
handler = "index.handler"
runtime = "python3.12"
memory_size = 128
architectures = ["x86_64"]
}
}
# Defines the first Cortex custom Lambda function.
resource "aws_lambda_function" "cortex_custom_lambda" {
filename = "source_code/cortex_custom_lambda.zip"
source_code_hash = filebase64sha256("source_code/cortex_custom_lambda.zip")
function_name = var.cortex_custom_lambda_name_1
role = aws_iam_role.cortex_custom_lambda.arn
handler = local.common_lambda_settings.handler
runtime = local.common_lambda_settings.runtime
memory_size = local.common_lambda_settings.memory_size
architectures = local.common_lambda_settings.architectures
timeout = 75
tags = {
yor_trace = "4edbaf52-b78d-4ad3-8a67-c435c4583d6f"
}
}
# Defines the Lambda function responsible for emptying S3 buckets.
resource "aws_lambda_function" "empty_bucket_lambda" {
filename = "source_code/empty_bucket_lambda.zip"
source_code_hash = filebase64sha256("source_code/empty_bucket_lambda.zip")
function_name = var.empty_bucket_lambda_name
role = aws_iam_role.empty_bucket_lambda.arn
handler = local.common_lambda_settings.handler
runtime = local.common_lambda_settings.runtime
memory_size = local.common_lambda_settings.memory_size
architectures = local.common_lambda_settings.architectures
timeout = 600
tags = {
yor_trace = "d5aa41a6-602f-49eb-bdc1-a4b199c99dd3"
}
}
# Defines the second Cortex custom Lambda function.
resource "aws_lambda_function" "cortex_custom_lambda_2" {
filename = "source_code/cortex_custom_lambda_2.zip"
source_code_hash = filebase64sha256("source_code/cortex_custom_lambda_2.zip")
function_name = var.cortex_custom_lambda_name_2
role = aws_iam_role.cortex_custom_lambda_2.arn
handler = local.common_lambda_settings.handler
runtime = local.common_lambda_settings.runtime
memory_size = local.common_lambda_settings.memory_size
architectures = local.common_lambda_settings.architectures
timeout = 75
tags = {
yor_trace = "8bb83fd0-d44c-41f8-989d-d53e06a2599f"
}
code_signing_config_arn = "CKV_ANY"
}