December 15, 2024AWS

Cutting AWS Costs by 97%: A Real Migration Story

How we took an AWS bill from $487/month to under $10 by migrating off WordPress on Lightsail to serverless — the architecture, the migration steps, and the final numbers.

When we started Castaneda Networks, we made the same mistake many companies make: we over-engineered our infrastructure. Our simple company website was running on a WordPress multisite installation on Amazon Lightsail, costing us $32 per month when you included all the associated services. Today, that same site runs for less than $3 per month with better performance and zero maintenance.

Here's exactly how we did it, and how you can apply these same principles to slash your AWS costs.

The Problem: Overprovisioned and Underutilized

Our initial setup seemed reasonable at the time:

  • WordPress on Lightsail: $12/month for the instance
  • Orphaned WAF Web ACLs: $20/month (from old projects we forgot about)
  • Static IP: Allocated but unused
  • Regular maintenance: WordPress updates, plugin management, security patches

$32 Monthly Before vs $2.50 Monthly After

Monthly Before ($32)Monthly After ($2.50)
HostingWordPress hostingS3 storage
NetworkWAF chargesCloudFront CDN
UpkeepMaintenance timeZero maintenance
Speed3-5 second load times<300ms load times

Step 1: Audit Your AWS Bill

The first step to reducing costs is understanding where your money is going. We used AWS Cost Explorer to analyze our spending and discovered significant savings opportunities.

Key Finding: We were paying $20/month for WAF Web ACLs from projects that had been decommissioned months ago. These orphaned resources were silently draining our budget.

To audit your own AWS bill:

  • Open AWS Cost Explorer in your console
  • Group costs by service
  • Look for services you don't recognize or remember setting up
  • Check for resources in regions you don't actively use

Step 2: Identify Static Content Opportunities

We realized our WordPress site was essentially static - we updated content maybe once a month. The dynamic features we were paying for (comments, user accounts, forms) could all be replaced with modern alternatives:

  • Contact forms: Replaced with serverless Lambda + SES
  • Comments: We didn't need them
  • Content management: Git-based workflow is actually easier

Step 3: Implement the Static Site Architecture

Our new architecture is embarrassingly simple but incredibly powerful. Learn more about serverless vs traditional architectures to understand why this approach works so well:

S3 Bucket (Static Files)
    ↓
CloudFront CDN (Global Distribution)
    ↓
Route 53 (DNS)
    ↓
Your Users (Happy & Fast Experience)

S3 Configuration

Setting up S3 for static hosting is straightforward:

aws s3 mb s3://your-domain-name
aws s3 website s3://your-domain-name --index-document index.html --error-document error.html
aws s3 sync ./your-site s3://your-domain-name --delete

CloudFront Setup

CloudFront provides global CDN capabilities, SSL certificates, and caching:

  • Origin: Your S3 bucket
  • Viewer Protocol Policy: Redirect HTTP to HTTPS
  • Caching: 1 year for assets, 1 hour for HTML
  • Compression: Enabled for all text-based files

Step 4: Handle Dynamic Functionality

For the contact form, we built a simple serverless function:

// Lambda function for contact form
exports.handler = async (event) => {
    const { name, email, message } = JSON.parse(event.body);

    // Send email via SES
    await ses.sendEmail({
        Source: 'noreply@yourdomain.com',
        Destination: { ToAddresses: ['your@email.com'] },
        Message: {
            Subject: { Data: `Contact from ${name}` },
            Body: { Text: { Data: message } }
        }
    }).promise();

    return {
        statusCode: 200,
        body: JSON.stringify({ success: true })
    };
};

Step 5: Optimize for Performance

The performance improvements were dramatic:

  • First Contentful Paint: 3.2s → 0.3s
  • Time to Interactive: 5.1s → 0.8s
  • PageSpeed Score: 67 → 100

These improvements came from:

  • Eliminating WordPress overhead
  • CloudFront edge caching
  • Optimized images and assets
  • No database queries
  • Minimal JavaScript

The Results: 83% Cost Reduction

Final Numbers:
  • Monthly cost: $32 → $2.50 (92% reduction)
  • Annual savings: $354
  • Performance: 10x faster
  • Maintenance: Zero
  • Uptime: 99.99% (AWS SLA)

When This Approach Makes Sense

This serverless static site approach is perfect for:

  • Company websites and landing pages
  • Documentation sites
  • Blogs (with static site generators)
  • Marketing campaigns
  • Portfolio sites

You might need a different approach if you have:

  • Real-time user interactions
  • Complex user authentication
  • Frequent content updates by non-technical users
  • E-commerce with inventory management

Key Takeaways

Our journey from $32/month to $2.50/month taught us valuable lessons:

  • Audit regularly: We found $20/month in forgotten resources
  • Question complexity: Our "dynamic" site was 99% static
  • Embrace serverless: Lambda + S3 + CloudFront is incredibly powerful
  • Performance matters: Faster sites convert better
  • Simplicity scales: Less complexity = less cost + less maintenance

Planning a build?

We're a small app development studio that ships production software — not slide decks. Get an honest estimate with no strings attached.

Get a Free Project Estimate