Skip to content

Commit

Permalink
Merge pull request #140 from FloRul/rich_pdf_ingestion_lambda
Browse files Browse the repository at this point in the history
try again
  • Loading branch information
joelbalcaen authored Apr 4, 2024
2 parents 3edf634 + 4f909ed commit 3bc8c93
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
19 changes: 9 additions & 10 deletions lambdas/rich_pdf_ingestion/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lambdas/rich_pdf_ingestion/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
variable "aws_region" {
type = string
nullable = false
}

variable "lambda_storage_bucket" {
type = string
nullable = false
}
16 changes: 9 additions & 7 deletions terraform/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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

}

0 comments on commit 3bc8c93

Please sign in to comment.