Hi,
I currently have a Lambda that is triggered upon uploading a PDF document to an S3 bucket. Once called, the Lambda calls the start_document_text_detection method to extract the document text. The job gets published to an SNS topic and another Lambda gets triggered on completion to get_document_text_detection method to retrieve the results and upload it into said bucket.
If I upload a document to the root of the S3 bucket, everything works great. My issue is that when I create a folder within the S3 bucket and upload a PDF there, the trigger fires but I am getting the following error :
[ERROR] InvalidParameterException: An error occurred (InvalidParameterException) when calling the StartDocumentTextDetection operation: Request has invalid parameters
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 33, in lambda_handler
raise e
File "/var/task/lambda_function.py", line 26, in lambda_handler
'SNSTopicArn': os.environ['sns_arn']
File "/opt/python/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/opt/python/botocore/client.py", line 661, in _make_api_call
raise error_class(parsed_response, operation_name)
SNSTopicARN being part of the NotificationChannel argument to the start_document_text_detection call. The RoleARN also has FullSNSAccess policy and the JobTag is the document name if that helps. I checked the limits of Textract and everything is within bounds. I also tried adjusting the prefix in the Events property of the S3 bucket to match the folder, with no luck.
Any advice would be appreciated.