The Challenge

Our application imports user registrations from a third-party service, but there was a catch: user profile photos aren't included in the API integration. The only way to obtain these images is through a manual bulk download process. Once downloaded, these photos needed to be properly hosted and made accessible to our mobile application.

This presented two main technical challenges:

  • Infrastructure: Set up robust and scalable image hosting
  • Automation: Create a reliable way to process and upload thousands of photos

Planning Phase

Rather than diving straight into code, I started by discussing the architecture with Windsurf. I laid out the problem and made sure it had the right context—we were already using AWS, had existing Terraform infrastructure, and didn't have an existing content management system. 

We settled on a solid, straightforward approach: host the images in an S3 bucket with CloudFront for distribution, plus a Node.js script in our repository to handle uploads. Nothing revolutionary, but the planning conversation helped me think through available options and details I might have missed. With the architecture decided, it was time to generate the code.

Building Infrastructure with Terraform

S3 Bucket

Creating an S3 bucket is straightforward with Terraform, but we had valuable back-and-forth on security and management best practices. Windsurf helped me add a lifecycle policy, enable versioning, block public access, and configure server-side encryption—details I might have missed on my first iteration.

CloudFront Distribution

The real challenge was setting up a CloudFront distribution mapped to our custom domain. This involved certificate management, DNS routing, and origin configurations, all new territory for me. Windsurf helped me generate the code and additionally learn about CloudFront's capabilities and optimal configurations. The generated Terraform code was clean and production-ready.

A screen shot of a computer

AI-generated content may be incorrect.
Snippet of the generated CloudFront distribution Terraform module
Building the Upload Script

The script development process highlighted an area where Windsurf excels: utility tools. It generated a working script immediately, handling the AWS SDK I'd never used, filesystem operations, and even using glob patterns to match files. This is the type of tedious, research-heavy work where AI shows its worth. 

Initial Implementation

The first version was surprisingly robust for an initial attempt. It handled command-line arguments, read files from disk, and used the S3 client to upload them seamlessly. It even generated a detailed upload summary; a nice touch I likely wouldn't have had time to add myself.

A blue background with white text

AI-generated content may be incorrect.
Basic upload summary
Iterative Refinement

Through our back-and-forth, the script evolved significantly:

  • Comprehensive input validation: Users could specify all the necessary parameters
  • Pre-execution summaries: Clear overview of what will happen before any files are touched
  • Custom filename processing: Specific logic for our use case where filenames needed pre-processing
  • Detailed execution reporting: A complete summary of upload results
A computer screen shot of a program

AI-generated content may be incorrect.
The parameter input process
A computer screen shot of a number

AI-generated content may be incorrect.
Sample pre-execution summary
Dependency Management

One particularly elegant solution emerged when I realized the script was pulling in AWS dependencies that didn't need to be part of our main application build. Windsurf helped me restructure the code:

A screenshot of a computer

AI-generated content may be incorrect.
New upload images module

The solution was to create a separate module with its own package.json, keeping the upload script and its dependencies isolated from the main application.

The Results

Any experienced developer could build this manually. The value wasn't in doing something impossible, it was in speed and learning acceleration.

What this saved me
  • Research time: Learning AWS SDK, CloudFront configurations and Terraform syntax
  • Implementation time: Less than 1 day instead of an estimated 2-3 days
  • Quality iterations: Got production-ready infrastructure and user-friendly scripts from the start
Key Takeaways
  • Planning matters: The collaborative architecture discussion was as valuable as code generation
  • Quality by default: I got robust solutions that normally would have only been achieved iteratively over time
  • Learning without friction: I understood everything that was built without hours of documentation diving
  • Confidence expansion: I'm now tackling challenges that previously would have been out of scope

AI powered development tools are just that, tools. They need someone to drive them and provide context. But used correctly, they're invaluable for expanding what feels feasible for individual developers.

Technologies