Skip to content

Commit 6d0ec99

Browse files
committed
CCM-8574: package layer code in pre.sh
1 parent 09dbd96 commit 6d0ec99

File tree

15 files changed

+38
-119
lines changed

15 files changed

+38
-119
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
root_dir=$(git rev-parse --show-toplevel)
12

23
npm ci
34

45
npm run generate-dependencies --workspaces --if-present
6+
7+
$root_dir/layers/pdfjs/package.sh
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
root_dir=$(git rev-parse --show-toplevel)
2+
13
if [ -z "$SKIP_SANDBOX_INSTALL" ]; then npm ci; fi
24

35
npm run generate-dependencies --workspaces --if-present
6+
7+
$root_dir/layers/pdfjs/package.sh

infrastructure/terraform/modules/backend-api/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ No requirements.
3636
| <a name="module_get_template_lambda"></a> [get\_template\_lambda](#module\_get\_template\_lambda) | ../lambda-function | n/a |
3737
| <a name="module_lambda_copy_scanned_object_to_internal"></a> [lambda\_copy\_scanned\_object\_to\_internal](#module\_lambda\_copy\_scanned\_object\_to\_internal) | ../lambda-function | n/a |
3838
| <a name="module_lambda_delete_failed_scanned_object"></a> [lambda\_delete\_failed\_scanned\_object](#module\_lambda\_delete\_failed\_scanned\_object) | ../lambda-function | n/a |
39-
| <a name="module_lambda_layer_pdfjs"></a> [lambda\_layer\_pdfjs](#module\_lambda\_layer\_pdfjs) | ../lambda_layer | n/a |
4039
| <a name="module_lambda_set_file_virus_scan_status"></a> [lambda\_set\_file\_virus\_scan\_status](#module\_lambda\_set\_file\_virus\_scan\_status) | ../lambda-function | n/a |
4140
| <a name="module_lambda_validate_letter_template_files"></a> [lambda\_validate\_letter\_template\_files](#module\_lambda\_validate\_letter\_template\_files) | ../lambda-function | n/a |
4241
| <a name="module_list_template_lambda"></a> [list\_template\_lambda](#module\_list\_template\_lambda) | ../lambda-function | n/a |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_lambda_layer_version" "pdfjs" {
2+
layer_name = "${local.csi}-nodejs20-pdfjs-dist"
3+
description = "pdfjs-dist dependencies for nodejs20.x"
4+
filename = local.pdfjs_layer_filepath
5+
source_code_hash = filebase64sha256(local.pdfjs_layer_filepath)
6+
compatible_runtimes = ["nodejs20.x"]
7+
}

infrastructure/terraform/modules/backend-api/locals.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
locals {
22
csi = "${var.csi}-${var.component}"
33

4-
monorepo_root = abspath("${path.module}/../../../..")
5-
lambdas_source_code_dir = abspath("${local.monorepo_root}/lambdas")
6-
pdfjs_layer_source_code_dir = abspath("${local.monorepo_root}/layers/pdfjs")
4+
monorepo_root = abspath("${path.module}/../../../..")
5+
lambdas_source_code_dir = abspath("${local.monorepo_root}/lambdas")
6+
pdfjs_layer_filepath = abspath("${local.monorepo_root}/layers/pdfjs/dist/layer.zip")
77

88
openapi_spec = templatefile("${path.module}/spec.tmpl.json", {
99
AWS_REGION = var.region

infrastructure/terraform/modules/backend-api/module_lambda_layer_pdfjs.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

infrastructure/terraform/modules/backend-api/module_lambda_validate_letter_template_files.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module "lambda_validate_letter_template_files" {
77
filename = module.build_template_lambda.zips[local.backend_lambda_entrypoints.validate_letter_template_files].path
88
function_name = "${local.csi}-validate-letter-template-files"
99
handler = "validate-letter-template-files.handler"
10-
layer_arns = [module.lambda_layer_pdfjs.layer_arn]
10+
layer_arns = [aws_lambda_layer_version.pdfjs.arn]
1111
log_retention_in_days = var.log_retention_in_days
1212
memory_size = 1024
1313
source_code_hash = module.build_template_lambda.zips[local.backend_lambda_entrypoints.validate_letter_template_files].base64sha256

infrastructure/terraform/modules/lambda_layer/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

infrastructure/terraform/modules/lambda_layer/data_archive_file_zip.tf

Lines changed: 0 additions & 6 deletions
This file was deleted.

infrastructure/terraform/modules/lambda_layer/lambda_layer_version_main.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)