My Journey from DigitalOcean to AWS with Terraform

My Journey from DigitalOcean to AWS with Terraform

Transitioning from DigitalOcean to AWS wasn’t just a technical challenge—it was a significant milestone in my professional growth. In this post, I’ll share my practical journey of migrating an application stack using Terraform for infrastructure automation, focusing on lessons learned, solutions found, and what’s next.

Initial Stack: Proving the Concept

I began with a straightforward stack:

  • n8n for automation workflows.
  • OpenWebUI, a chat interface connecting with external LLMs via Ollama.
  • Traefik for secure HTTPS with Let’s Encrypt.

Initially deployed on DigitalOcean, the setup validated the applications’ interoperability but lacked scalability and robustness. AWS, with its vast ecosystem, was my clear next step.

Why AWS and Terraform?

Holding AWS certifications (Cloud Practitioner and AI Practitioner), I knew the theoretical advantages of AWS. This project was my chance to apply that knowledge practically. Terraform attracted me due to its infrastructure-as-code capabilities, promising consistency, reproducibility, and efficient management of AWS resources.

Learning Terraform, Step-by-Step

Migrating my stack required methodically translating a Docker Compose configuration into Terraform scripts. This deep dive required me to answer critical questions:

  • Networking: I defined VPCs, subnets, Internet Gateways, and route tables for secure, reliable internet access.
  • Compute: I selected suitable EC2 instance types and Amazon Machine Images (AMIs) and ensured static addressing with Elastic IP.
  • Storage: Created persistent EBS volumes, formatted, mounted, and configured them to ensure data persistence across restarts.
  • Security: Set up AWS Security Groups to precisely manage firewall rules, allowing necessary traffic only.
  • Terraform Best Practices: Learned remote state management using S3 buckets and DynamoDB for state locking, crucial for professional workflows.

The user_data script was particularly crucial, automating:

  • Docker and Docker Compose installation.
  • User setup and permissions.
  • EBS volume handling, ensuring consistency regardless of device naming.
  • Application-specific configurations, including SSL certificates for Traefik.

Challenges and Solutions: Dealing with Rate Limits

No real-world migration goes without bumps. Configuring HTTPS certificates via Let’s Encrypt initially resulted in hitting rate limits due to excessive certificate requests during testing. This experience emphasized the importance of careful configuration and testing against staging environments—a valuable lesson learned the hard way.

Success: Terraform Infrastructure Live on AWS

Seeing the infrastructure successfully spin up with terraform apply, and securely accessing n8n and OpenWebUI via HTTPS was extremely rewarding. The practical knowledge gained was transformative.

Next Steps: Qdrant, Ansible, and Client Scaling

With AWS and Terraform foundations established, my next steps are ambitious:

  • Qdrant Integration: Adding vector database capabilities for enhanced AI functionalities.
  • Ansible Automation: Learning Ansible to automate deployments, manage Docker Compose configurations, and streamline maintenance tasks.
  • Scaling for Clients: Ultimately, combining Terraform’s environment modularity with Ansible’s automation to support multiple client environments effectively.

Reflecting on the Experience

This project underscored a crucial insight: certifications build foundational knowledge, but hands-on projects provide real expertise. Terraform has revolutionized how I approach cloud deployments, shifting towards consistency, reliability, and scalability.

If you’re exploring AWS, Terraform, or building AI-driven applications, I’d love to hear about your journey—let’s connect!


Comments

2 responses to “My Journey from DigitalOcean to AWS with Terraform”

  1. David Avatar
    David

    Great work on this migration! Your methodical approach from networking to compute really shows solid engineering thinking. The Let’s Encrypt rate limiting lesson is a classic “rite of passage” – we’ve all been there.

    Looking forward to seeing your Qdrant integration. Vector databases are becoming essential for AI workloads, and you’ve built a solid Terraform foundation for it.

    Your point about certifications vs. hands-on experience is spot-on. Keep documenting these journeys – they’re valuable for others on similar paths.

  2. Lyas Spiehler Avatar
    Lyas Spiehler

    I started my cloud journey with DigitalOcean too. It’s great when you’re starting out and just need a VM or two, but easy to grow out of when your requirements get a little more complicated. I only just recently used Traefik for the first time and was pretty blown away by the native docker integration. You seem to be picking up these technologies so quickly. I’m eager to see what cool things you’re able to build. Incredible work!

Leave a Reply to Lyas Spiehler Cancel reply

Your email address will not be published. Required fields are marked *