In this step, you will test the UploadInvoiceFileFunction Lambda Function by uploading a sample invoice file to the S3 bucket. The purpose of this test is to verify the entire processing workflow, from file upload to S3, data extraction with Textract, analysis with Bedrock, and storage in DynamoDB.
Before testing the Lambda function, prepare a sample invoice file to upload. Please download the following file:
🔧 Note: If you use a different invoice file, rename it to demo_invoice.png before uploading to the uploads/ folder in S3.









Navigate to the UploadInvoiceFileFunction function.
Click the Test tab to create a new Test Event.
Event name: TestUploadInvoice.

{
"Records": [
{
"eventVersion": "2.1",
"eventSource": "aws:s3",
"awsRegion": "us-east-1",
"eventTime": "2025-07-31T12:00:00.000Z",
"eventName": "ObjectCreated:Put",
"s3": {
"bucket": {
"name": "invoice-upload-s3-bucket"
},
"object": {
"key": "uploads/demo_invoice.png"
}
}
}
]
}



Observe the Execution results displayed after the run:









⚠️ Warning: Ensure all resources (Lambda, S3, DynamoDB, Textract, and Bedrock) are in the same region: N. Virginia (us-east-1) to ensure proper system synchronization.