diff --git a/lambdas/rich_pdf_ingestion/lambda.tf b/lambdas/rich_pdf_ingestion/lambda.tf index f55969a..4139672 100644 --- a/lambdas/rich_pdf_ingestion/lambda.tf +++ b/lambdas/rich_pdf_ingestion/lambda.tf @@ -10,16 +10,15 @@ data "aws_caller_identity" "current" {} module "lambda_function_container_image" { - create_package = false - image_uri = data.aws_ecr_image.lambda_image.image_uri - package_type = "Image" - source = "terraform-aws-modules/lambda/aws" - function_name = local.lambda_function_name - publish = true - runtime = local.runtime - timeout = local.timeout - layers = [local.powertools_layer_arn] - source_path = "${path.module}/src" + source = "terraform-aws-modules/lambda/aws" + function_name = local.lambda_function_name + handler = "index.lambda_handler" + publish = true + runtime = local.runtime + timeout = local.timeout + layers = [local.powertools_layer_arn] + source_path = "${path.module}/src" + s3_bucket = var.lambda_storage_bucket memory_size = 256 role_name = "${local.lambda_function_name}-role" attach_policy_statements = true diff --git a/lambdas/rich_pdf_ingestion/variables.tf b/lambdas/rich_pdf_ingestion/variables.tf index 0647e46..2c4d097 100644 --- a/lambdas/rich_pdf_ingestion/variables.tf +++ b/lambdas/rich_pdf_ingestion/variables.tf @@ -1,4 +1,9 @@ variable "aws_region" { type = string nullable = false +} + +variable "lambda_storage_bucket" { + type = string + nullable = false } \ No newline at end of file diff --git a/terraform/modules.tf b/terraform/modules.tf index 4008521..da837ab 100644 --- a/terraform/modules.tf +++ b/terraform/modules.tf @@ -118,14 +118,14 @@ module "email_response_processor" { } module "email_request_processor" { - source = "../lambdas/EmailProcessor/EmailRequestProcessorFunction/iac" - lambda_function_name = local.email_request_processor_lambda_name + source = "../lambdas/EmailProcessor/EmailRequestProcessorFunction/iac" + lambda_function_name = local.email_request_processor_lambda_name lambda_storage_bucket = aws_s3_bucket.lambda_storage.id - sqs_name = local.email_request_processor_queue_name - api_key = aws_api_gateway_api_key.this.value - api_url = "${aws_api_gateway_deployment.this.invoke_url}${aws_api_gateway_stage.this.stage_name}/${module.inference.path_part}" - response_queue_url = module.email_response_processor.queue_url - response_queue_arn = module.email_response_processor.queue_arn + sqs_name = local.email_request_processor_queue_name + api_key = aws_api_gateway_api_key.this.value + api_url = "${aws_api_gateway_deployment.this.invoke_url}${aws_api_gateway_stage.this.stage_name}/${module.inference.path_part}" + response_queue_url = module.email_response_processor.queue_url + response_queue_arn = module.email_response_processor.queue_arn } module "email_request_preprocessor" { @@ -228,4 +228,6 @@ module "email_receipt_confirmation" { module "rich_pdf_ingestion" { source = "../lambdas/rich_pdf_ingestion" aws_region = var.aws_region + lambda_storage_bucket = aws_s3_bucket.lambda_storage.id + }