|
1 |
| -# module "lambda_identification_nationalid" { |
2 |
| -# source = "https://github.com/soat-tech-challenge/lambda-identification-nationalid/releases/download/phase-4/artifact-phase-5.zip" |
3 |
| -# } |
| 1 | +module "lambda_identification_nationalid" { |
| 2 | + source = "https://github.com/soat-tech-challenge/lambda-identification-nationalid/releases/download/phase-4/artifact-phase-5.tar.gz" |
| 3 | +} |
4 | 4 |
|
5 |
| -# module "lambda_authorizer_client" { |
6 |
| -# source = "https://github.com/soat-tech-challenge/lambda-authorizer-client/releases/download/phase-4/artifact-phase-5.zip" |
7 |
| -# } |
| 5 | +module "lambda_authorizer_client" { |
| 6 | + source = "https://github.com/soat-tech-challenge/lambda-authorizer-client/releases/download/phase-4/artifact-phase-5.tar.gz" |
| 7 | +} |
8 | 8 |
|
9 |
| -# data "archive_file" "lambda1" { |
10 |
| -# type = "zip" |
11 |
| -# source_file = "${path.module}/init.tpl" |
12 |
| -# output_path = "${path.module}/files/init.zip" |
13 |
| -# } |
| 9 | +data "archive_file" "lambda_identification_nationalid" { |
| 10 | + type = "zip" |
| 11 | + source_dir = "${path.module}/.terraform/modules/lambda_identification_nationalid" |
| 12 | + output_path = "${path.module}/lambda1.zip" |
| 13 | +} |
14 | 14 |
|
15 |
| -# resource "aws_lambda_function" "identification_nationalid" { |
16 |
| -# filename = terraform_data.download_archive_lambda1.output |
17 |
| -# function_name = "SOAT_TC_Lambda_Identification_NationalID" |
18 |
| -# description = "Generates Client JWT using National ID" |
19 |
| -# role = data.aws_iam_role.lab_role.arn |
20 |
| -# handler = "index.handler" |
| 15 | +data "archive_file" "lambda_authorizer_client" { |
| 16 | + type = "zip" |
| 17 | + source_dir = "${path.module}/.terraform/modules/lambda_authorizer_client" |
| 18 | + output_path = "${path.module}/lambda2.zip" |
| 19 | +} |
21 | 20 |
|
22 |
| -# source_code_hash = filebase64sha256(terraform_data.download_archive_lambda1.output) |
| 21 | +resource "aws_lambda_function" "identification_nationalid" { |
| 22 | + filename = data.archive_file.lambda_identification_nationalid.output_path |
| 23 | + function_name = "SOAT_TC_Lambda_Identification_NationalID" |
| 24 | + description = "Generates Client JWT using National ID" |
| 25 | + role = data.aws_iam_role.lab_role.arn |
| 26 | + handler = "index.handler" |
23 | 27 |
|
24 |
| -# runtime = "nodejs20.x" |
| 28 | + source_code_hash = data.archive_file.lambda_identification_nationalid.output_base64sha256 |
25 | 29 |
|
26 |
| -# environment { |
27 |
| -# variables = { |
28 |
| -# BACKEND_URL = local.alb_url |
29 |
| -# JWT_PRIVATE_KEY = var.client_jwt_private_key |
30 |
| -# } |
31 |
| -# } |
| 30 | + runtime = "nodejs20.x" |
32 | 31 |
|
33 |
| -# vpc_config { |
34 |
| -# subnet_ids = local.private_subnets_ids |
35 |
| -# security_group_ids = [local.default_sg_id] |
36 |
| -# } |
| 32 | + environment { |
| 33 | + variables = { |
| 34 | + BACKEND_URL = local.alb_url |
| 35 | + JWT_PRIVATE_KEY = var.client_jwt_private_key |
| 36 | + } |
| 37 | + } |
37 | 38 |
|
38 |
| -# logging_config { |
39 |
| -# log_format = "Text" |
40 |
| -# log_group = aws_cloudwatch_log_group.lambda_identification_nationalid.name |
41 |
| -# } |
42 |
| -# } |
| 39 | + vpc_config { |
| 40 | + subnet_ids = local.private_subnets_ids |
| 41 | + security_group_ids = [local.default_sg_id] |
| 42 | + } |
43 | 43 |
|
44 |
| -# resource "aws_lambda_function" "authorizer_client" { |
45 |
| -# filename = terraform_data.download_archive_lambda2.output |
46 |
| -# function_name = "SOAT_TC_Lambda_Authorizer_Client" |
47 |
| -# description = "Authorizer Lambda for Client requests" |
48 |
| -# role = data.aws_iam_role.lab_role.arn |
49 |
| -# handler = "index.handler" |
| 44 | + logging_config { |
| 45 | + log_format = "Text" |
| 46 | + log_group = aws_cloudwatch_log_group.lambda_identification_nationalid.name |
| 47 | + } |
| 48 | +} |
50 | 49 |
|
51 |
| -# source_code_hash = filebase64sha256(terraform_data.download_archive_lambda2.output) |
| 50 | +resource "aws_lambda_function" "authorizer_client" { |
| 51 | + filename = data.archive_file.lambda_authorizer_client.output_path |
| 52 | + function_name = "SOAT_TC_Lambda_Authorizer_Client" |
| 53 | + description = "Authorizer Lambda for Client requests" |
| 54 | + role = data.aws_iam_role.lab_role.arn |
| 55 | + handler = "index.handler" |
52 | 56 |
|
53 |
| -# runtime = "nodejs20.x" |
| 57 | + source_code_hash = data.archive_file.lambda_authorizer_client.output_base64sha256 |
54 | 58 |
|
55 |
| -# environment { |
56 |
| -# variables = { |
57 |
| -# BACKEND_URL = local.alb_url |
58 |
| -# JWT_PRIVATE_KEY = var.client_jwt_private_key |
59 |
| -# } |
60 |
| -# } |
| 59 | + runtime = "nodejs20.x" |
61 | 60 |
|
62 |
| -# logging_config { |
63 |
| -# log_format = "Text" |
64 |
| -# log_group = aws_cloudwatch_log_group.lambda_authorizer_client.name |
65 |
| -# } |
66 |
| -# } |
| 61 | + environment { |
| 62 | + variables = { |
| 63 | + BACKEND_URL = local.alb_url |
| 64 | + JWT_PRIVATE_KEY = var.client_jwt_private_key |
| 65 | + } |
| 66 | + } |
| 67 | + |
| 68 | + logging_config { |
| 69 | + log_format = "Text" |
| 70 | + log_group = aws_cloudwatch_log_group.lambda_authorizer_client.name |
| 71 | + } |
| 72 | +} |
0 commit comments