From 65195104f1e50ffb4b73d8f8a28c4c6964aa81c4 Mon Sep 17 00:00:00 2001 From: Joel Balcaen Date: Fri, 5 Apr 2024 08:58:27 -0300 Subject: [PATCH] fix indentation --- lambdas/rich_pdf_ingestion/lambda.tf | 7 +++---- lambdas/rich_pdf_ingestion/src/index.py | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lambdas/rich_pdf_ingestion/lambda.tf b/lambdas/rich_pdf_ingestion/lambda.tf index 3f64fb4..a9fc76c 100644 --- a/lambdas/rich_pdf_ingestion/lambda.tf +++ b/lambdas/rich_pdf_ingestion/lambda.tf @@ -23,10 +23,9 @@ module "lambda_function_container_image" { memory_size = 256 role_name = "${local.lambda_function_name}-role" attach_policy_statements = true - - create_package = false - image_uri = data.aws_ecr_image.lambda_image.image_uri - package_type = "Image" + create_package = false + image_uri = data.aws_ecr_image.lambda_image.image_uri + package_type = "Image" policy_statements = { log_group = { diff --git a/lambdas/rich_pdf_ingestion/src/index.py b/lambdas/rich_pdf_ingestion/src/index.py index ba2b40d..ac39c53 100644 --- a/lambdas/rich_pdf_ingestion/src/index.py +++ b/lambdas/rich_pdf_ingestion/src/index.py @@ -3,7 +3,6 @@ import boto3 from pypdf import PdfReader import json -from botocore.exceptions import NoCredentialsError, BotoCoreError, ClientError OBJECT_CREATED = "ObjectCreated" @@ -31,17 +30,17 @@ def fetch_file(bucket, key): s3 = boto3.client("s3") local_filename = f"/tmp/{key.split('/')[-1]}" - try: - s3.download_file(bucket, key, local_filename) - except NoCredentialsError as e: - print(e) - raise e - except BotoCoreError as e: - print(e) - raise e - except ClientError as e: - print(e) - raise e + + s3.download_file(bucket, key, local_filename) + # except NoCredentialsError as e: + # print(e) + # raise e + # except BotoCoreError as e: + # print(e) + # raise e + # except ClientError as e: + # print(e) + # raise e return local_filename