Repository navigation
Expand file tree
/
Copy pathlambda_functions.tf
More file actions
55 lines (46 loc) · 1.89 KB
/
Copy pathlambda_functions.tf
File metadata and controls
55 lines (46 loc) · 1.89 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
# Build and deploy security-questions-lambda
data "archive_file" "security_questions_lambda_zip" {
type = "zip"
source_dir = "${path.module}/lambdas/securityquestions/source/"
output_path = "${path.module}/lambdas/securityquestions/lambda_function.zip"
}
resource "aws_lambda_function" "security_questions" {
function_name = "security-questions-lambda"
role = aws_iam_role.lambda_role_security_questions.arn
handler = "securityquestions.lambda_handler"
runtime = "python3.9"
filename = data.archive_file.security_questions_lambda_zip.output_path
source_code_hash = filebase64sha256(data.archive_file.security_questions_lambda_zip.output_path)
memory_size = 1024
timeout = 600
environment {
variables = {
KNOWLEDGE_BASE_ID = aws_bedrockagent_knowledge_base.security_data.id
MODEL_ARN = local.model_arn
REGION_NAME = var.aws_region
}
}
}
# Build and deploy sync-knowledge-base-lambda
data "archive_file" "sync_knowledge_base_lambda_zip" {
type = "zip"
source_dir = "${path.module}/lambdas/syncknowledgebase/source/"
output_path = "${path.module}/lambdas/syncknowledgebase/lambda_function.zip"
}
resource "aws_lambda_function" "sync_knowledge_base" {
function_name = "sync-knowledgebase-lambda"
role = aws_iam_role.lambda_role_sync_kb.arn
handler = "syncknowledgebase.lambda_handler"
runtime = "python3.9"
filename = data.archive_file.sync_knowledge_base_lambda_zip.output_path
source_code_hash = filebase64sha256(data.archive_file.sync_knowledge_base_lambda_zip.output_path)
memory_size = 1024
timeout = 600
environment {
variables = {
KNOWLEDGE_BASE_ID = aws_bedrockagent_knowledge_base.security_data.id
DATA_SOURCE_ID = aws_bedrockagent_data_source.security_data.data_source_id
REGION_NAME = var.aws_region
}
}
}