This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Exploring the Possibilities
What I Built
What I was going for initially was an AWS Lambda-Based mini-clone of Cloudinary's cloud-based image processing API platform, but in the process I realized that Amazon's Q Developer cli produced code flexible enough to integrate with most external npm libraries out there.
Both API responsibilities and layers are separated so that external libraries such as pdf conversion utilities and 3d renders can be included in the future dynamically and with minimal effort.
So overall what was made, is a node.js v.17^ compliant image processing utility that currently supports the following:
- Several Image Transformation Operations (Resize, Blur, Grayscale conversion, Format Conversion, Quality Enhancement etc.)
- Image to Pdf Conversion Operations (Image to PDF conversion, PDF Metadata editing, Auto resize to fit-image-to PDF).
- Can be run on the cloud for automation via Lambda API Gateway.
- Includes built-in infrastructure templates to add WAF (Web Application Firewall) with relevant rate limitation for overusing AWS Lambda endpoints.
- Can be run by docker (included in the documentation).
Entire Architecture Presented below
What is not added (yet):
- STL file import /processing for 3d content.
- Handling multiple images in parallel.
- More usable and friendlier UI.
- Additional tests and infrastructure checks.
Demo
Standard use case displayed below:
and in animated capture below:
Code Repository
All code is strictly written by Amazon Q + VS Code (yes even README.md) and presented with the relevant documentation in the publicized repository in the link below:
chrdek
/
PicProcessor
AWS Lambda function for image processing and PDF conversion with DDoS protection and Docker support
Image Processor Lambda Function πΌοΈ
Generated with Amazon Q π€ π¦
This project contains an AWS Lambda function built with Node.js 17+ that processes images from an S3 bucket and returns them through API Gateway. The implementation includes robust DDoS protection, rate limiting, PDF conversion, and Docker support for local development and testing.
Project Structure
PicProcessor/
βββ src/ # Source code for the Lambda function
β βββ index.js # Main Lambda handler with rate limiting
β βββ imageProcessor.js # Image processing logic
β βββ pdfConverter.js # PDF conversion functionality
β βββ local.js # Local development server
βββ tests/ # Unit tests using Mocha and Chai
β βββ index.test.js # Tests for the Lambda handler
β βββ imageProcessor.test.js # Tests for the image processor
β βββ pdfConverter.test.js # Tests for the PDF converter
βββ localstack/ # LocalStack initialization scripts
β βββ init-s3.sh # Script to initialize S3 bucket
βββ Dockerfile.lambda #
β¦How I Used Amazon Q Developer
What I used, was VS Code + Amazon Q plugin.
Codewise, an empty folder and a .gitignore file with Amazon Q plugin + VS Code was created to get me started. (Note: The ignore file was overwritten by Amazon Q later in the process).
Using this little, Amazon Q handles all the workload for you and code modifications from within VS Code when adding or handling file changes.
Overall, no code was written by myself. Only git commands to deploy to remote repository.
AI-Guided Coding process was like so:
- Generated Code based on node version + packages required as dependencies.
- Generated the corresponding tests code parts to run alongside the parts of the code.
- Generated lambda-relevant code for usage of api gateway + corresponding deployment templates. This was also updated to include code for handling uploaded files on the s3 bucket.
- Added more features like WAF (Web Application Firewall) so that to handle rate limiting for the api etc.
- Generated the code files for docker and docker-compose usage.
- Updated when necessary and informed the AI of changes and noted to update the relevant files (Repeat until satisfied).
This was also to have a proof-of-concept of how capable a 2025 AI is in writing code. All infrastructure deployment files + Readme/Licenses added by A.I. assistant and some Amazon Q IDE plugin responses are shown below:
Importantly highlighted part of this is that Amazon Q added (and justified the license referenced in the readme). By default it selected ISC due to the nature of the solution (node.js with Npm packages in the json file).
OVERALL: A major benefit of using the IDE alongside the built-in plugin is that you get to modify your own context and thus, easily bulk-update the files included already in your solution.