In this workshop, you are going to build a full-fledged, event-driven, serverless application for image recognition. With the aid of Amazon CodeWhisperer, you'll write your own code that runs on top of AWS Lambda to interact with Amazon Rekognition, Amazon DynamoDB, Amazon SNS, Amazon SQS, Amazon S3, third-party HTTP APIs to perform image recognition. The users can interact with the application by either sending the URL of an image for processing, or by listing the images and the objects present on each image.
This workshop breaks down the application into the following three segments:
Image download - The user provides an image URL to the first API. A Lambda function downloads the image from the URL, and stores it on a S3 bucket. S3 automatically sends a notification to a SNS topic informing that a new image is ready for processing. SNS then delivers the message to a SQS queue .
Image recognition - A second Lambda function handles the orchestration and processing of the image. It receives the message from the SQS queue, sends the image for Amazon Rekognition to process, stores the recognition results on a DynamoDB table, and sends a message with those results as JSON to a second SNS topic used in section three. A user can list the images and the objects present on each image by calling a second API which queries such DynamoDB table.
3rd party integration - A third Lambda function reads the message from the second SQS queue. At this point, the function has to deliver that message to a fictitious external e-mail server that supports only XML. Because of that, the function converts the JSON message to XML. Last, the function sends the XML object via HTTP POST to the e-mail server.