Skip to content

Commit

Permalink
fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Balcaen committed Apr 5, 2024
1 parent 72c3c79 commit 6519510
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
7 changes: 3 additions & 4 deletions lambdas/rich_pdf_ingestion/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
23 changes: 11 additions & 12 deletions lambdas/rich_pdf_ingestion/src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import boto3
from pypdf import PdfReader
import json
from botocore.exceptions import NoCredentialsError, BotoCoreError, ClientError


OBJECT_CREATED = "ObjectCreated"
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 6519510

Please sign in to comment.