AWS Builder Center
Why I Ditched Manual AWS Deployments: Moving My Full-Stack App to S3 and CloudFront

Why I Ditched Manual AWS Deployments: Moving My Full-Stack App to S3 and CloudFront

A breakdown of the lessons learned transitioning a frontend build away from manual server configurations to a low-cost, scalable AWS architecture.

Why I Ditched Manual AWS Deployments: Moving My Full-Stack App to S3 and CloudFront

When you start learning cloud computing, clicking around the AWS Management Console feels exciting . You spin up an EC2 instance, SSH into it, pull your Git repo, install dependencies, and run your web app. It works, and it feels like magic.
Until you have to update a simple CSS style or fix a typo.
Suddenly, you find yourself repeating the same manual SSH steps every single time. That was exactly my reality a few weeks ago with a React and Node.js project. It became frustrating fast, which pushed me to rethink my approach and explore how to deploy frontends the modern way: using Amazon S3 and CloudFront .



The Problem with the "Just Put It on EC2" Mindset

For static frontend assets like built React or Next.js bundles, running a virtual machine around the clock is overkill.
  • Unnecessary Costs: An idle EC2 instance still consumes compute hours.
  • Maintenance Burden: You must manage OS updates, security patches, and server health.
  • Single Point of Failure: Without an Application Load Balancer and Auto Scaling, downtime is always a risk.
Frontend web applications generally consist of static HTML, CSS, JavaScript, and images once compiled. They do not require a persistent backend server process to serve those static files.



The Architecture Switch

To simplify management and reduce friction, I separated my frontend from the backend entirely:
  1. Amazon S3 (Simple Storage Service): Acts as the static file bucket storing the compiled production build files.
  1. Amazon CloudFront: Acts as the global Content Delivery Network (CDN) to cache assets closer to users, enabling HTTPS with low latency.
  1. AWS Certificate Manager (ACM): Provides free SSL/TLS certificates for custom domain routing.



3 Lessons Learned During the Transition

1. Bucket Policy Permissions Require Care

Keep the S3 bucket private. Instead of making the bucket publicly readable, configure CloudFront Origin Access Control (OAC). This ensures that traffic must pass through CloudFront rather than hitting the S3 origin directly.

2. Client-Side Routing Needs a Custom Error Page

With Single-Page Applications (SPAs), navigating directly to a deep link like  /dashboard  triggers an S3  403  or  404  error because that literal file path does not exist in the bucket. Configuring CloudFront to redirect  403  and  404  status codes back to  index.html  with a  200  response code resolves client-side route handling smoothly.

3. Invalidate Cache on New Builds

CloudFront caches assets aggressively across edge locations. Whenever you upload a new build to S3, remember to create a CloudFront invalidation (for example,  /* ) so users immediately receive the updated version.



What’s Next on My DevOps Path?

Decoupling the frontend cut my hosting setup down to virtually zero maintenance. My next milestone is setting up an automated CI/CD pipeline using GitHub Actions to run tests, build the bundle, and sync directly to S3 on every push to  main .
If you have automated your deployments using Terraform or AWS CDK, I’d love to hear your advice in the comments below! What was your biggest takeaway when moving away from manual console deployments ?
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article