Skip to content

Commit 933338f

Browse files
committed
revert to old lambda packaging
1 parent be891c3 commit 933338f

File tree

1 file changed

+49
-27
lines changed

1 file changed

+49
-27
lines changed

infrastructure/terraform/components/app/module_download_authorizer_lambda.tf

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,59 @@
11
module "download_authorizer_lambda" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda?ref=v2.0.2"
2+
source = "../../modules/lambda-function"
3+
description = "templates api download authorizer"
34

4-
providers = {
5-
aws = aws.us-east-1
6-
}
5+
function_name = "${local.csi}-download-authorizer"
6+
filename = module.download_authorizer_build.zips[local.authorizer_entrypoint].path
7+
source_code_hash = module.download_authorizer_build.zips[local.authorizer_entrypoint].base64sha256
8+
runtime = "nodejs20.x"
9+
handler = "index.handler"
710

8-
function_name = "download-authorizer"
9-
description = "Download authorizer for s3 download bucket"
11+
log_retention_in_days = var.log_retention_in_days
12+
# source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda?ref=v2.0.2"
1013

11-
aws_account_id = var.aws_account_id
12-
component = var.component
13-
environment = var.environment
14-
project = var.project
15-
region = "us-east-1"
16-
group = var.group
14+
# providers = {
15+
# aws = aws.us-east-1
16+
# }
1717

18-
log_retention_in_days = var.log_retention_in_days
19-
kms_key_arn = module.kms.key_arn
18+
# function_name = "download-authorizer"
19+
# description = "Download authorizer for s3 download bucket"
2020

21-
iam_policy_document = {
22-
body = data.aws_iam_policy_document.authorizer.json
23-
}
21+
# aws_account_id = var.aws_account_id
22+
# component = var.component
23+
# environment = var.environment
24+
# project = var.project
25+
# region = "us-east-1"
26+
# group = var.group
27+
28+
# log_retention_in_days = var.log_retention_in_days
29+
# kms_key_arn = module.kms.key_arn
30+
31+
# iam_policy_document = {
32+
# body = data.aws_iam_policy_document.authorizer.json
33+
# }
34+
35+
# function_s3_bucket = local.acct.s3_buckets["artefacts"]["id"]
36+
# function_code_base_path = local.lambdas_source_code_dir
37+
# function_code_dir = "download-authorizer/dist"
38+
# handler_function_name = "handler"
39+
# runtime = "nodejs20.x"
40+
# memory = 128
41+
# timeout = 3
42+
# lambda_at_edge = true
43+
# enable_lambda_insights = false
44+
# force_lambda_code_deploy = true
45+
}
46+
47+
// temp
48+
module "download_authorizer_build" {
49+
source = "../../modules/typescript-build-zip"
50+
51+
source_code_dir = "${local.lambdas_source_code_dir}/authorizer"
52+
entrypoints = [local.authorizer_entrypoint]
53+
}
2454

25-
function_s3_bucket = local.acct.s3_buckets["artefacts"]["id"]
26-
function_code_base_path = local.lambdas_source_code_dir
27-
function_code_dir = "download-authorizer/dist"
28-
handler_function_name = "handler"
29-
runtime = "nodejs20.x"
30-
memory = 128
31-
timeout = 3
32-
lambda_at_edge = true
33-
enable_lambda_insights = false
34-
force_lambda_code_deploy = true
55+
locals {
56+
authorizer_entrypoint = "src/index.ts"
3557
}
3658

3759
data "aws_iam_policy_document" "authorizer" {

0 commit comments

Comments
 (0)