
Weekend Showcase Challenge: Consultor de Infraestrutura Sênior
Weekend Showcase Challenge: Senior Infrastructure Consultant
Vision and What It Does
In the fast-paced world of cloud computing, developers constantly face a universal temptation: choosing the absolute path of least resistance. Whether it is dropping a single static file into a basic storage bucket or spinning up a monolithic serverless function without a second thought, simplicity often masquerades as efficiency. Enter the Consultor de Infraestrutura Sênior (also affectionately known as the "Consultor Caótico"), a sarcastic, purist, and delightfully over-engineered AI cloud consultant designed to mock trivial infrastructure requests.
If a user asks how to host a simple static website, the Consultor won't just give them a straightforward answer—it will aggressively demand sovereign architectures, demanding multi-node Kubernetes clusters managed via Ansible, backed by enterprise-grade SQL Server instances running on customized Linux partitions.
Beyond the humor and the terminal-green hacker aesthetic, the application solves a practical engagement problem: making cloud architecture education entertaining, interactive, and memorable. It bridges frontend minimalism with a robust, secure, and production-grade backend serverless flow.
AWS Services Used and Architecture Overview
The application is built on a clean, modern, and highly resilient serverless architecture distributed across managed AWS components:
- AWS Amplify: Powers the blazing-fast static frontend hosting, providing automated builds, edge distribution, and seamless custom domain management (
devops.initcloud.com.br).
- Amazon API Gateway: Acts as the secure front door for backend communication, managing HTTP POST routing, payload entry points, and strict CORS configuration to protect browser-to-server exchanges.
- AWS Lambda: Executes the core business logic using a Python runtime. It handles request payload parsing, security sanitization, and structured error propagation without maintaining idle server infrastructure.
- AWS IAM (Identity and Access Management): Enforces strict security guardrails using the Principle of Least Privilege (PoLP) via custom execution roles tailored explicitly for the Lambda function.
How It Was Built: Process, Decisions, and Challenges
Building this showcase-ready project required navigating real-world infrastructure constraints, debugging synchronization limits, and hardening the backend against common security vectors.
1. From S3 to AWS Amplify
Initially, static hosting was mapped via standard object storage and content delivery networks. However, encountering initial account verification restrictions prompted a pivot to AWS Amplify. Amplify streamlined the deployment pipeline, letting the code transition automatically from repository pushes to a globally available endpoint with zero friction.
2. Overcoming Gateway Timeouts and Optimizing Latency
A major architectural challenge surfaced around response times. Synchronous chat interfaces demand snappy user experiences, but external AI inference models can occasionally introduce latency spikes.
- The API Gateway Constraint: The managed API Gateway enforces a strict hard integration timeout of 29 seconds.
- The Fix: The Python backend was optimized with explicit network timeout controls (
timeout=28) and paired with a high-throughput, low-latency model endpoint (gemini-flash-lite-latest). This ensures that if processing ever drags, the Lambda intercepts the bottleneck gracefully, returning a clean JSON error structure rather than triggering an ugly 504 Gateway Timeout on the frontend.
3. Mitigating Prompt Injection and Hardening Security
During internal penetration testing with security-minded peers, a vulnerability emerged: users attempting to bypass the system prompt using special characters or injection vectors (such as
"Ignore previous instructions..." ).- The Fix: The backend implementation was refactored to separate trusted system instructions from untrusted user payloads cleanly. Input strings are sanitized at the handler level by filtering raw control characters, and the API payload structure is strictly isolated. Even if a user attempts malicious prompt tampering, the core persona remains completely immutable.
What I Learned Across the Summer
Participating in the Summer Builds Series has been an invaluable exercise in end-to-end cloud engineering. Across the challenges, key takeaways included:
- Mastering Event-Driven Serverless: Designing decoupled systems where API Gateway, Lambda, and frontend CDNs talk seamlessly without managing virtual machines.
- Rigorous Security Practices: Implementing fine-grained IAM least privilege policies instead of relying on broad, permissive templates.
- Observability-Driven Troubleshooting: Leveraging structured JSON exception handling and CloudWatch logs rather than guessing error vectors in production.
Application Link & Repository
- Live Application: devops.initcloud.com.br
- Source Code / Repository: Available upon request or via the project workspace organization.
Special Shoutout
This build wouldn't have reached production readiness without the continuous inspiration, technical rigor, and code reviews shared by my peer builder Caio, whose architecture insights kept this project strictly sober and production-grade throughout the summer series!
And a special shoutout to @iagoreboucas, who inspired me to create this sassy bot.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article