test new pdf layer build

This commit is contained in:
Grzegorz Huber
2024-07-15 16:40:40 +02:00
parent b87ed9dc15
commit 84f4f3eb3e
3 changed files with 30 additions and 28 deletions
+1 -1
View File
@@ -394,4 +394,4 @@ pipelines:
script:
- *aws-context-uat
- pip install -r requirements.txt
- BB_PIPELINE_BRANCH="UAT" python terraform.py apply --environment=uat --module=textract-pipeline/terraform --apply-extra-args="-target=module.pdf_layer"
- BB_PIPELINE_BRANCH="UAT" python terraform.py apply --environment=uat --module=textract-pipeline/terraform
-26
View File
@@ -194,29 +194,3 @@ resource "aws_iam_role_policy_attachment" "VPC-policy-attach" {
policy_arn = "${data.aws_iam_policy.AWSLambdaVPCAccessExecutionRole.arn}"
}
module "pdf_layer" {
source = "terraform-aws-modules/lambda/aws"
create_layer = true
layer_name = "pdfcryptolayer2-terraform"
description = "Fixed PDF layer"
compatible_runtimes = ["python3.12"]
build_in_docker = true
source_path = {
path = "../src/lambda-layer/pypdf2-layer-new",
prefix_in_zip = "python"
# npm_requirements = "package.json"
commands = [
"pip install -r requirements.txt -t .",
":zip . python"
],
patterns = [
"!.*/.*\\.txt", # Skip all txt files recursively
],
}
store_on_s3 = false
}
@@ -438,6 +438,33 @@ module "tiff_to_pdf_lambda_function" {
tags = local.common_tags
}
module "pdf_validation_lambda_layer" {
source = "terraform-aws-modules/lambda/aws"
create_layer = true
layer_name = local.pdf_validation_lambda_name
description = "Fixed PDF layer"
compatible_runtimes = ["python3.12"]
build_in_docker = true
source_path = {
path = "../src/lambda-layer/pypdf2-layer-new",
prefix_in_zip = "python"
# npm_requirements = "package.json"
commands = [
"pip install -r requirements.txt -t .",
":zip . python"
],
patterns = [
"!.*/.*\\.txt", # Skip all txt files recursively
],
}
store_on_s3 = false
}
# pdf validation lambda function
module "pdf_validation_lambda_function" {
source = "terraform-aws-modules/lambda/aws"
@@ -452,8 +479,9 @@ module "pdf_validation_lambda_function" {
ephemeral_storage_size = var.pdf_validation_lambda.ephemeral_storage_size
architectures = var.pdf_validation_lambda.architectures
# TODO remove the old
layers = [
module.lambda_layer_pypdf2.lambda_layer_arn
module.pdf_validation_lambda_layer.lambda_layer_arn
]
environment_variables = local.environment_variables