<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cloud and Devops]]></title><description><![CDATA[Cloud and Devops]]></description><link>https://blogs.paragpatil.in</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 18:16:02 GMT</lastBuildDate><atom:link href="https://blogs.paragpatil.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Deploying Frontend Apps on AWS CloudFront: A Step-by-Step Guide for Developers]]></title><description><![CDATA[Many developers out there are using popular frontend hosting platforms like Vercel or Netlify to host their frontend applications. These platforms are quite developer friendly so it becomes easy for a new developer to host their code on these platfor...]]></description><link>https://blogs.paragpatil.in/deploying-frontend-apps-on-aws-cloudfront-a-step-by-step-guide-for-developers</link><guid isPermaLink="true">https://blogs.paragpatil.in/deploying-frontend-apps-on-aws-cloudfront-a-step-by-step-guide-for-developers</guid><category><![CDATA[cloudfront]]></category><category><![CDATA[React]]></category><category><![CDATA[React Native]]></category><category><![CDATA[S3 static website hosting]]></category><category><![CDATA[Static Website]]></category><category><![CDATA[hosting]]></category><category><![CDATA[AWS]]></category><dc:creator><![CDATA[Parag Patil]]></dc:creator><pubDate>Sat, 11 Oct 2025 18:48:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1760206434710/9b635799-5356-43dc-a95f-12c1ce6d2ad2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Many developers out there are using popular frontend hosting platforms like Vercel or Netlify to host their frontend applications. These platforms are quite developer friendly so it becomes easy for a new developer to host their code on these platforms to showcase their projects or portfolio.</p>
<p>Meanwhile in an enterprise where most of the workloads are running on Cloud platforms like AWS. AWS provides various option to run your code. You can either use AWS Amplify to build and host your code. Or you can create a EC2 server, configure NGINX inside that server and then host your code inside it. Although these AWS services lack some features like Caching and the pricing might be a bit on a higher side.<br />So, the industry standard practice is hosting the code using Cloudfront and S3  </p>
<p>What is Cloudfront?</p>
<p>AWS CloudFront is a Content Delivery Network (CDN) that distributes your application across multiple edge locations worldwide. Here's why it's perfect for frontend applications:</p>
<ul>
<li><p><strong>Global Performance</strong>: Your app loads quickly regardless of user location</p>
</li>
<li><p><strong>Cost-Effective</strong>: Pay only for what you use, with a generous free tier</p>
</li>
<li><p><strong>SSL/HTTPS</strong>: Free SSL certificates for secure connections</p>
</li>
<li><p><strong>Scalability</strong>: Handles traffic spikes effortlessly</p>
</li>
<li><p><strong>Low Latency</strong>: Edge caching reduces server response times dramatically</p>
</li>
</ul>
<p>What is S3?  </p>
<p>S3 stands for Simple Storage Service. It is a Storage service offered by AWS where you can store anything. Consider it like a Google Drive but in AWS.</p>
<p>Here’s what our setup looks like:</p>
<ol>
<li><p><strong>S3 Bucket</strong>: Stores your static React build files</p>
</li>
<li><p><strong>CloudFront Distribution</strong>: Serves content from edge locations worldwide</p>
</li>
<li><p><strong>Route 53</strong> (Optional): Manages your custom domain</p>
</li>
</ol>
<h2 id="heading-step-by-step-deployment">Step-by-Step Deployment</h2>
<h3 id="heading-1-build-your-react-application">1. Build Your React Application</h3>
<p>First, create your production-ready build:</p>
<pre><code class="lang-bash">npm run build
</code></pre>
<p>This generates an optimized <code>build/</code> folder with all your static assets.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760205630918/31309b10-1d97-49c7-b168-b061faeee5e2.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-2-create-an-s3-bucket">2. Create an S3 Bucket</h3>
<p>Log into AWS Console and create an S3 bucket:</p>
<ul>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760205677261/4239547c-8f13-41c0-9646-ef5902b987ea.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Enter a unique name under Bucket Name and keep other settings as it is.</p>
</li>
<li><p>Click on Create Bucket</p>
</li>
</ul>
<h3 id="heading-3-upload-your-build-files">3. Upload Your Build Files</h3>
<p>Once your S3 Bucket is created . Upload everything from your <code>build/</code> folder to the S3 bucket.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760205997920/c32942dd-86fc-4c88-9290-626a5f8e6862.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760206012417/848de917-e02f-4ae5-828c-8410189b2a44.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-4-create-cloudfront-distribution">4. Create CloudFront Distribution</h3>
<p>This is where the magic happens:</p>
<ul>
<li><p>Create a Cloudfront Distribution</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760207048777/27d06380-8d7e-4560-ae63-16a949ede97d.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<ul>
<li><p>Give a distribution name and click Next</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760207100522/f4d1660c-aa74-4e49-a8a2-57db3bf1a5a4.png" alt class="image--center mx-auto" /></p>
<p>  Make sure the origin type is selected as Amazon S3 and then click on Browse S3 button to select your S3 bucket</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760207204818/414cc6db-6bf4-43df-87ba-dc3f2aa9462b.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Leave other options as it is and then click on Next</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760207263441/729d6374-82ed-4c33-95f0-a62f1181706e.png" alt class="image--center mx-auto" /></p>
<p>  As of now click on “Do not enable security protections” to save WAF costs and click Next.<br />  <strong>Note - In production use cases, you should always enable WAF to avoid security attacks like SQL injection, DDoS etc.</strong></p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760207406491/60a44b43-a266-4c01-ba7c-f20f8bd09bd8.png" alt class="image--center mx-auto" /></p>
<p>  Click on Create distribution to create the cloudfront distribution</p>
</li>
</ul>
<h3 id="heading-7-wait-and-test">7. Wait and Test</h3>
<p>CloudFront distributions take 15-20 minutes to deploy. Once complete, you'll get a CloudFront URL like <a target="_blank" href="http://d1234abcd.cloudfront.net"><code>d1234abcd.cloudfront.net</code></a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760208164126/73b2fffe-03c7-4532-ba6a-84632b6682e4.png" alt class="image--center mx-auto" /></p>
<p>Click on Edit button</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760208312844/865d0fcc-b4e9-4384-abba-463c3d491068.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p>Enter the default root object as index.html so that the user will be directly redirected to index.html page once he hits our cloudfront URL</p>
</li>
<li><p>Click on Save Changes and wait for few minutes until the new changes get deployed</p>
</li>
<li><p>After few minutes, hit the cloudfront URL and you can see your frontend react application</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760208399139/4b26ba10-ce06-4f2e-8187-e90f8f9197cb.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Hosting your React application on CloudFront provides enterprise-grade performance and reliability without the complexity. The combination of S3 for storage and CloudFront for distribution creates a robust, scalable solution that can handle traffic from a handful of users to millions.</p>
<p>The setup process might seem involved initially, but once configured, deployments are straightforward. Your users get blazing-fast load times, you get peace of mind knowing your app scales automatically, and your wallet stays happy with AWS's competitive pricing.</p>
<blockquote>
<p>Please delete all the AWS resources when not in use to save costs.</p>
</blockquote>
]]></content:encoded></item></channel></rss>