<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CHANDRA PRABHA V</title>
    <description>The latest articles on DEV Community by CHANDRA PRABHA V (@chandra_prabha_v).</description>
    <link>https://dev.to/chandra_prabha_v</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4125481%2Fbca9d500-97bb-4274-a1e5-a8bc420c447f.png</url>
      <title>DEV Community: CHANDRA PRABHA V</title>
      <link>https://dev.to/chandra_prabha_v</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chandra_prabha_v"/>
    <language>en</language>
    <item>
      <title>Chandra Meets CodeDeploy: My First AWS Deployment Journey</title>
      <dc:creator>CHANDRA PRABHA V</dc:creator>
      <pubDate>Wed, 16 Sep 2026 01:30:57 +0000</pubDate>
      <link>https://dev.to/chandra_prabha_v/chandra-meets-codedeploy-my-first-aws-deployment-journey-2oom</link>
      <guid>https://dev.to/chandra_prabha_v/chandra-meets-codedeploy-my-first-aws-deployment-journey-2oom</guid>
      <description>&lt;h1&gt;
  
  
  Chandra Meets CodeDeploy: My First AWS Deployment Journey ☁️
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Exploring how AWS CodeDeploy makes application deployment easier, faster, and more reliable.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In software development, creating an application is only the beginning. After writing code, developers must move it from their computers to a server where users can access it. This process is called &lt;strong&gt;deployment&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Imagine a student team developing a college placement prediction application. Every time the team improves the machine learning model or updates the website, they need to transfer the new files to the server, configure the application, and restart it. Doing this manually can be time-consuming and may cause errors.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;AWS CodeDeploy&lt;/strong&gt; becomes useful. It automates the deployment of application updates to supported computing environments. In this blog, I will explore what AWS CodeDeploy is, how it works, its important features, and how a college student project can benefit from it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is AWS CodeDeploy?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AWS CodeDeploy&lt;/strong&gt; is a fully managed deployment service provided by Amazon Web Services (AWS). It helps developers automatically deploy application code, configuration files, scripts, and other application content to computing environments.&lt;/p&gt;

&lt;p&gt;CodeDeploy supports three major compute platforms:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Amazon EC2 and on-premises servers:&lt;/strong&gt; Deploy applications to cloud-based or supported physical servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Lambda:&lt;/strong&gt; Deploy new versions of serverless functions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon ECS:&lt;/strong&gt; Deploy updated containerized applications.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It can retrieve application revisions from sources such as Amazon S3 and supported source-code repositories, depending on the deployment platform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo7dequshw9edcebp2cnk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo7dequshw9edcebp2cnk.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Was CodeDeploy Created?
&lt;/h3&gt;

&lt;p&gt;Before automated deployment tools became common, developers often copied files manually to servers and executed several commands to update an application. This process could lead to configuration mistakes, inconsistent deployments, and application downtime.&lt;/p&gt;

&lt;p&gt;AWS CodeDeploy was created to simplify this process. It allows developers to define deployment instructions once and reuse them whenever a new application version is released.&lt;/p&gt;

&lt;p&gt;Instead of repeatedly performing deployment tasks manually, developers can allow CodeDeploy to install the new version, execute required scripts, monitor the deployment, and report whether it succeeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;At a high level, CodeDeploy follows a simple pattern:&lt;/p&gt;

&lt;p&gt;You store your application code in a source location (GitHub, S3, or CodeCommit).&lt;br&gt;
You describe the deployment steps in a file called appspec.yml, which lives with your code.&lt;br&gt;
CodeDeploy picks up the revision, copies it to your target instances (or updates your Lambda/ECS version), and runs the lifecycle hooks defined in appspec.yml in order — stopping the old version, installing the new one, and starting it back up.&lt;br&gt;
If you've attached CloudWatch alarms, CodeDeploy watches them during the rollout and automatically rolls back if something looks unhealthy.&lt;/p&gt;

&lt;p&gt;Here's a simplified view of that flow:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9685aic4qule2pycrh9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9685aic4qule2pycrh9w.png" alt=" " width="799" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Diagram: Developer → Source Repo → CodeDeploy reads appspec.yml → Deployment Group runs lifecycle hooks (ApplicationStop → DownloadBundle → BeforeInstall → Install/AfterInstall → ApplicationStart/ValidateService) → CloudWatch monitors health and can trigger rollback.)&lt;/p&gt;

&lt;p&gt;Key Features&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Automated, consistent deployments Once configured, deployments happen the same way every time — no manually remembering which command to run on which server. This removes a huge class of human error.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple deployment strategies CodeDeploy supports in-place deployments (update the existing instances one at a time or in batches) and blue/green deployments (spin up a new fleet, shift traffic over, and terminate the old one only after the new one is verified). This lets you choose between speed and safety depending on the project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automatic rollback on failure If a deployment fails a lifecycle event or trips a CloudWatch alarm, CodeDeploy can automatically roll back to the last known good version — something that's genuinely hard to build reliably by hand.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Works across compute types The same core service deploys to EC2/on-premises servers, Lambda functions, and ECS containers, so you don't need a completely different tool depending on your architecture.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;College / Student Use Case&lt;/p&gt;

&lt;p&gt;Here's where this becomes directly relevant to campus life. At CIT, several departments run small internal web apps — placement portals, event registration pages, club websites (like our Rotaract Club page), or student project demos hosted for review. Right now, most of these are deployed manually: someone logs into a server, pulls the latest code, and restarts it, often right before a demo deadline.&lt;/p&gt;

&lt;p&gt;A practical use case: our department could host student mini-project demos (like a Flask-based ML model demo) on a small EC2 instance, with CodeDeploy watching the GitHub repository. Every time a student pushes an update before their review, CodeDeploy automatically redeploys the latest version to the demo server — no manual server access needed, and no risk of forgetting a step under deadline pressure. If the new version crashes, CodeDeploy rolls back automatically, so the demo server never goes down entirely.&lt;/p&gt;

&lt;p&gt;Simple Example&lt;/p&gt;

&lt;p&gt;A minimal appspec.yml for deploying a small web app to EC2 looks like this:&lt;/p&gt;

&lt;p&gt;yaml&lt;br&gt;
version: 0.0&lt;br&gt;
os: linux&lt;br&gt;
files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;source: /
destination: /var/www/student-project
hooks:
BeforeInstall:

&lt;ul&gt;
&lt;li&gt;location: scripts/stop_server.sh
timeout: 60
AfterInstall:&lt;/li&gt;
&lt;li&gt;location: scripts/install_dependencies.sh
timeout: 180
ApplicationStart:&lt;/li&gt;
&lt;li&gt;location: scripts/start_server.sh
timeout: 60
ValidateService:&lt;/li&gt;
&lt;li&gt;location: scripts/health_check.sh
timeout: 60&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And triggering a deployment through the AWS CLI is just:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
aws deploy create-deployment \&lt;br&gt;
  --application-name student-demo-app \&lt;br&gt;
  --deployment-group-name demo-server-group \&lt;br&gt;
  --github-location repository=my-username/student-project,commitId=&lt;/p&gt;

&lt;p&gt;CodeDeploy then runs each hook script in order and reports success or failure in the console.&lt;/p&gt;
&lt;h2&gt;
  
  
  Key Features of AWS CodeDeploy
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Automated Deployments
&lt;/h3&gt;

&lt;p&gt;CodeDeploy automates the process of transferring and installing application updates. It reduces the need for developers to manually copy files, execute installation commands, and restart services.&lt;/p&gt;

&lt;p&gt;For example, a team can prepare a new version of a web application and use CodeDeploy to release it to a group of EC2 instances.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. In-Place and Blue/Green Deployments
&lt;/h3&gt;

&lt;p&gt;CodeDeploy supports different deployment strategies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In-place deployment:&lt;/strong&gt; The existing servers are updated with the new application version. The application may be stopped during the update, depending on the configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blue/green deployment:&lt;/strong&gt; A new environment is prepared with the updated application. After testing, traffic can be redirected from the old environment to the new one. This can reduce service interruptions and make testing safer.&lt;/p&gt;

&lt;p&gt;For EC2 deployments, CodeDeploy supports both in-place and blue/green strategies. Lambda and ECS deployments use blue/green deployment methods with traffic-shifting configurations.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Deployment Scripts Using AppSpec
&lt;/h3&gt;

&lt;p&gt;The AppSpec file is an important part of CodeDeploy. It defines how files should be copied and which scripts should run during different deployment stages.&lt;/p&gt;

&lt;p&gt;For example, a deployment may need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy application files to a particular folder.&lt;/li&gt;
&lt;li&gt;Install Python dependencies.&lt;/li&gt;
&lt;li&gt;Stop an older application process.&lt;/li&gt;
&lt;li&gt;Start the updated application.&lt;/li&gt;
&lt;li&gt;Run a validation command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These instructions can be stored in the AppSpec file and reused during future deployments.&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Monitoring and Rollback Support
&lt;/h3&gt;

&lt;p&gt;CodeDeploy provides deployment status information through the AWS Management Console and AWS CLI. Developers can check whether a deployment succeeded, failed, or is still in progress.&lt;/p&gt;

&lt;p&gt;Deployment configurations can also work with health checks and alarms. In suitable setups, failed deployments can be stopped or rolled back to a previous application version.&lt;/p&gt;
&lt;h2&gt;
  
  
  College/Student Use Case 🎓
&lt;/h2&gt;

&lt;p&gt;Consider a student team at a college developing a &lt;strong&gt;Placement Prediction Web Application&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The project uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python and Flask for the backend.&lt;/li&gt;
&lt;li&gt;A machine learning model to predict placement outcomes.&lt;/li&gt;
&lt;li&gt;HTML, CSS, and JavaScript for the frontend.&lt;/li&gt;
&lt;li&gt;An Amazon EC2 instance to host the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Initially, the team manually uploads updated Python files and the machine learning model to the EC2 server whenever they make changes. As the project grows, this becomes difficult to manage, especially when several students contribute code.&lt;/p&gt;

&lt;p&gt;The team can use AWS CodeDeploy to automate the process.&lt;/p&gt;

&lt;p&gt;Whenever the team prepares a new application version, they can package the Flask application, configuration files, and deployment scripts into a revision. The revision can be uploaded to Amazon S3. CodeDeploy can then deploy the revision to the EC2 instance.&lt;/p&gt;

&lt;p&gt;For example, when the team improves the prediction model, CodeDeploy can install the updated model and application files, execute the required scripts, and report the deployment result.&lt;/p&gt;

&lt;p&gt;This approach helps students understand real-world DevOps practices, reduces repetitive manual work, and creates a more organized deployment workflow.&lt;/p&gt;
&lt;h2&gt;
  
  
  Simple Practical Example
&lt;/h2&gt;

&lt;p&gt;Let us consider a basic Python Flask application deployed to an Ubuntu EC2 instance.&lt;/p&gt;
&lt;h3&gt;
  
  
  Project Structure
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-flask-app/
│
├── app.py
├── requirements.txt
├── appspec.yml
└── scripts/
    ├── install_dependencies.sh
    └── start_application.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  1. Flask Application
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;app.py&lt;/code&gt; file contains a simple web application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;flask&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;home&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello from AWS CodeDeploy!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0.0.0.0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. AppSpec File
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;appspec.yml&lt;/code&gt; file tells CodeDeploy where to copy the application files and which scripts to execute.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.0&lt;/span&gt;
&lt;span class="na"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;linux&lt;/span&gt;

&lt;span class="na"&gt;files&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
    &lt;span class="na"&gt;destination&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/home/ubuntu/my-flask-app&lt;/span&gt;

&lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;AfterInstall&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;location&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;scripts/install_dependencies.sh&lt;/span&gt;
      &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300&lt;/span&gt;
      &lt;span class="na"&gt;runas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu&lt;/span&gt;

  &lt;span class="na"&gt;ApplicationStart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;location&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;scripts/start_application.sh&lt;/span&gt;
      &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300&lt;/span&gt;
      &lt;span class="na"&gt;runas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;files&lt;/code&gt; section specifies the destination directory. The &lt;code&gt;hooks&lt;/code&gt; section defines scripts that run after installation and when the application starts.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Deployment Scripts
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;install_dependencies.sh&lt;/code&gt; script can install the Python packages required by the application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; /home/ubuntu/my-flask-app
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;start_application.sh&lt;/code&gt; script can start the Flask application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; /home/ubuntu/my-flask-app
&lt;span class="nb"&gt;nohup &lt;/span&gt;python3 app.py &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; app.log 2&amp;gt;&amp;amp;1 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These scripts are only a basic demonstration. In a production environment, a process manager such as &lt;code&gt;systemd&lt;/code&gt; should normally be used instead of repeatedly starting background processes with &lt;code&gt;nohup&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Deployment Process
&lt;/h3&gt;

&lt;p&gt;The student team can follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the application files and deployment scripts.&lt;/li&gt;
&lt;li&gt;Add the AppSpec file to the project.&lt;/li&gt;
&lt;li&gt;Package the files into a ZIP archive.&lt;/li&gt;
&lt;li&gt;Upload the archive to an Amazon S3 bucket.&lt;/li&gt;
&lt;li&gt;Create a CodeDeploy application using the EC2/On-Premises compute platform.&lt;/li&gt;
&lt;li&gt;Create a deployment group and identify the target EC2 instance.&lt;/li&gt;
&lt;li&gt;Install and configure the CodeDeploy agent on the instance.&lt;/li&gt;
&lt;li&gt;Start a deployment using the AWS Management Console or AWS CLI.&lt;/li&gt;
&lt;li&gt;Check the deployment status and test the Flask application.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The EC2 instance must have the necessary IAM permissions, and the CodeDeploy agent must be correctly installed and running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of AWS CodeDeploy
&lt;/h2&gt;

&lt;p&gt;AWS CodeDeploy offers several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Saves time:&lt;/strong&gt; Automates repetitive deployment tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduces manual errors:&lt;/strong&gt; Uses predefined deployment instructions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports different environments:&lt;/strong&gt; Works with EC2, supported on-premises servers, Lambda, and ECS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improves release management:&lt;/strong&gt; Makes it easier to deploy new application versions consistently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports safer updates:&lt;/strong&gt; Blue/green deployment strategies can reduce downtime and allow testing before shifting traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works with scaling infrastructure:&lt;/strong&gt; Deployments can target multiple instances and integrate with AWS services.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations and Things to Consider
&lt;/h2&gt;

&lt;p&gt;Although CodeDeploy is useful, it is not a complete replacement for every DevOps tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cost
&lt;/h3&gt;

&lt;p&gt;CodeDeploy does not charge an additional fee for deployments to Amazon EC2, on-premises instances, AWS Lambda, or Amazon ECS. However, the AWS resources used alongside it may incur charges.&lt;/p&gt;

&lt;p&gt;For example, students may need to pay for EC2 instances, Amazon S3 storage, data transfer, CloudWatch monitoring, or other services. AWS Free Tier eligibility and pricing conditions should be checked before using resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Complexity
&lt;/h3&gt;

&lt;p&gt;CodeDeploy requires configuration of IAM roles, deployment groups, application revisions, and, for EC2 deployments, the CodeDeploy agent. Beginners may need time to understand these components.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;p&gt;IAM permissions should follow the principle of least privilege. S3 buckets should be protected, credentials should not be stored inside application files, and deployment scripts should be reviewed before execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application Compatibility
&lt;/h3&gt;

&lt;p&gt;CodeDeploy automates deployment, but it does not automatically fix bugs in application code, configure every server dependency, or guarantee that an application will work after deployment. Developers must prepare correct scripts and test their applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;AWS CodeDeploy is a useful AWS service for automating application deployments. It helps developers move application updates to servers, Lambda functions, or ECS services in a more consistent and controlled manner.&lt;/p&gt;

&lt;p&gt;For college students, CodeDeploy provides practical experience with cloud computing, DevOps, deployment automation, IAM, and application release management. A student project such as a placement prediction application can benefit from fewer manual deployment steps and a more organized release process.&lt;/p&gt;

&lt;p&gt;As I explore AWS services, CodeDeploy shows me that building an application is only one part of software engineering. Delivering and maintaining that application reliably is equally important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chandra's takeaway:&lt;/strong&gt; CodeDeploy helps turn the process of “I finished my code” into “My updated application is deployed and ready to use.” ☁️&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html" rel="noopener noreferrer"&gt;AWS CodeDeploy: What is CodeDeploy?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/primary-components.html" rel="noopener noreferrer"&gt;AWS CodeDeploy: Primary Components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-steps-server.html" rel="noopener noreferrer"&gt;AWS CodeDeploy: Deployments on EC2/On-Premises&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure.html" rel="noopener noreferrer"&gt;AWS CodeDeploy: AppSpec File Structure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/documentation-overview/codedeploy/" rel="noopener noreferrer"&gt;AWS CodeDeploy: Official Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cloud</category>
      <category>codedeploy</category>
      <category>devops</category>
      <category>studentblog</category>
    </item>
    <item>
      <title>My AWS Learning Journey: CloudWatch, Lambda, IAM &amp; CloudFront</title>
      <dc:creator>CHANDRA PRABHA V</dc:creator>
      <pubDate>Wed, 16 Sep 2026 01:17:47 +0000</pubDate>
      <link>https://dev.to/chandra_prabha_v/my-aws-learning-journey-cloudwatch-lambda-iam-cloudfront-4n20</link>
      <guid>https://dev.to/chandra_prabha_v/my-aws-learning-journey-cloudwatch-lambda-iam-cloudfront-4n20</guid>
      <description>&lt;p&gt;As part of my cloud learning journey, I recently explored some important AWS services and learned how they work together to build, secure, monitor, and deliver cloud-based applications.&lt;/p&gt;

&lt;p&gt;The four services I focused on were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;☁️ AWS CloudWatch&lt;/li&gt;
&lt;li&gt;⚡ AWS Lambda&lt;/li&gt;
&lt;li&gt;🔐 AWS IAM&lt;/li&gt;
&lt;li&gt;🌍 Amazon CloudFront&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each service has a different purpose, but together they helped me understand some of the core concepts behind cloud computing.&lt;/p&gt;




&lt;h2&gt;
  
  
  ☁️ 1. AWS CloudWatch
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Amazon CloudWatch&lt;/strong&gt; is a monitoring and observability service in AWS.&lt;/p&gt;

&lt;p&gt;I learned how CloudWatch can be used to monitor AWS resources and applications by collecting metrics, logs, and events.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I learned:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Monitoring AWS resources&lt;/li&gt;
&lt;li&gt;Viewing metrics and logs&lt;/li&gt;
&lt;li&gt;Creating dashboards&lt;/li&gt;
&lt;li&gt;Setting alarms&lt;/li&gt;
&lt;li&gt;Understanding application and resource performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, CloudWatch can help monitor whether a service is running normally or whether something needs attention.&lt;/p&gt;

&lt;p&gt;This helped me understand that deploying an application is only one part of cloud computing. We also need to &lt;strong&gt;monitor what is happening after deployment&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffjrzp0jj42udaw4zakp6.png" alt=" " width="800" height="444"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  ⚡ 2. AWS Lambda
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AWS Lambda&lt;/strong&gt; is a serverless computing service that allows us to run code without managing servers.&lt;/p&gt;

&lt;p&gt;Instead of setting up a server and keeping it running continuously, we can create a Lambda function that runs when a particular event occurs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I learned:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Creating Lambda functions&lt;/li&gt;
&lt;li&gt;Running Python code using Lambda&lt;/li&gt;
&lt;li&gt;Understanding serverless computing&lt;/li&gt;
&lt;li&gt;Working with event-driven execution&lt;/li&gt;
&lt;li&gt;Understanding Lambda triggers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simple example is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event → Lambda Function → Process → Response&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was one of the interesting concepts I learned because it showed me how applications can execute code only when it is needed.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔐 3. AWS IAM
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AWS Identity and Access Management (IAM)&lt;/strong&gt; is used to control access to AWS resources.&lt;/p&gt;

&lt;p&gt;I learned that security is a major part of cloud computing. IAM allows us to control &lt;strong&gt;who can access what&lt;/strong&gt; in an AWS account.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I learned:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Users&lt;/li&gt;
&lt;li&gt;Groups&lt;/li&gt;
&lt;li&gt;Roles&lt;/li&gt;
&lt;li&gt;Policies&lt;/li&gt;
&lt;li&gt;Permissions&lt;/li&gt;
&lt;li&gt;Access control&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One important concept I understood was the &lt;strong&gt;principle of least privilege&lt;/strong&gt;, where users and services should receive only the permissions they actually need.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User → IAM Policy → AWS Resource&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This helped me understand why permissions should be carefully managed instead of simply giving every user full access. Apparently, giving everyone the keys to the kingdom is not considered a security strategy.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌍 4. Amazon CloudFront
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Amazon CloudFront&lt;/strong&gt; is a Content Delivery Network (CDN) service used to deliver content to users with low latency.&lt;/p&gt;

&lt;p&gt;I learned how CloudFront works with &lt;strong&gt;edge locations&lt;/strong&gt; to deliver content closer to users.&lt;/p&gt;

&lt;p&gt;A simplified flow is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User → CloudFront Edge Location → Origin → Content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The origin could be services such as Amazon S3 or an application server.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I learned:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;CDN concepts&lt;/li&gt;
&lt;li&gt;Edge locations&lt;/li&gt;
&lt;li&gt;Origins&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;Faster content delivery&lt;/li&gt;
&lt;li&gt;HTTPS and secure content delivery&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helped me understand how websites and applications can serve content efficiently to users in different geographical locations.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 How These Services Connect
&lt;/h2&gt;

&lt;p&gt;One of the most useful things I learned was that AWS services don't necessarily work in isolation.&lt;/p&gt;

&lt;p&gt;A simple cloud application could use:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IAM&lt;/strong&gt; → Controls access 🔐&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lambda&lt;/strong&gt; → Runs application logic ⚡&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CloudFront&lt;/strong&gt; → Delivers content globally 🌍&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CloudWatch&lt;/strong&gt; → Monitors the application ☁️&lt;/p&gt;

&lt;p&gt;So, together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             👤 User
                |
                v
        🌍 CloudFront
                |
                v
          ⚡ Application
                |
             Lambda
                |
                v
        ☁️ CloudWatch
          Monitoring

        🔐 IAM
     Access &amp;amp; Permissions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gave me a better understanding of how different AWS services can form parts of a complete cloud architecture.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎓 What I Gained From This Learning
&lt;/h2&gt;

&lt;p&gt;Exploring these services helped me understand several important cloud concepts:&lt;/p&gt;

&lt;p&gt;✅ Serverless computing&lt;br&gt;
✅ Cloud monitoring&lt;br&gt;
✅ Identity and access management&lt;br&gt;
✅ CDN and content delivery&lt;br&gt;
✅ Event-driven architecture&lt;br&gt;
✅ Cloud security&lt;br&gt;
✅ AWS resource management&lt;/p&gt;

&lt;p&gt;More importantly, I started looking at cloud applications not just as code running somewhere on the internet, but as a combination of &lt;strong&gt;compute, security, monitoring, and delivery&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Keep learning. Keep building. ☁️🚀&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  AWS #AmazonWebServices #CloudComputing #CloudWatch #AWSLambda #IAM #CloudFront #Serverless #DevOps #LearningInPublic #TechLearning
&lt;/h1&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>learning</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Hosting My Portfolio on AWS S3 with CloudFront</title>
      <dc:creator>CHANDRA PRABHA V</dc:creator>
      <pubDate>Tue, 15 Sep 2026 06:59:07 +0000</pubDate>
      <link>https://dev.to/chandra_prabha_v/hosting-my-portfolio-on-aws-s3-with-cloudfront-4b2c</link>
      <guid>https://dev.to/chandra_prabha_v/hosting-my-portfolio-on-aws-s3-with-cloudfront-4b2c</guid>
      <description>&lt;h1&gt;
  
  
  Hosting My Portfolio on AWS S3 with CloudFront
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I wanted to host my personal portfolio using AWS and understand how a static website can be deployed using cloud services.&lt;/p&gt;

&lt;p&gt;For this project, I used &lt;strong&gt;Amazon S3&lt;/strong&gt; to store my portfolio files and &lt;strong&gt;Amazon CloudFront&lt;/strong&gt; to deliver the website through a secure and fast content delivery network (CDN).&lt;/p&gt;

&lt;p&gt;The final architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet
   |
   v
CloudFront
   |
   | Origin Access Control
   v
S3 Bucket
   |
   +-- index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  One important part of this setup is that the S3 bucket remains &lt;strong&gt;private&lt;/strong&gt;.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Technologies Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon S3&lt;/strong&gt; - Stores the portfolio files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon CloudFront&lt;/strong&gt; - Delivers the website globally through a CDN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt; - Creates the structure of the portfolio.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS&lt;/strong&gt; - Provides styling for the portfolio.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 1: Creating the S3 Bucket
&lt;/h1&gt;

&lt;p&gt;First, I logged in to the &lt;strong&gt;AWS Management Console&lt;/strong&gt; and searched for &lt;strong&gt;S3&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I opened Amazon S3 and selected:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create bucket&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I entered a unique bucket name.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chandra-prabha-portfolio-2026
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bucket name must be globally unique because S3 bucket names are shared across AWS.&lt;/p&gt;

&lt;p&gt;For the AWS Region, I selected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Asia Pacific (Mumbai) - ap-south-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Bucket Configuration
&lt;/h3&gt;

&lt;p&gt;For &lt;strong&gt;Object Ownership&lt;/strong&gt;, I kept:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ACLs disabled
Bucket owner enforced
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;strong&gt;Block Public Access&lt;/strong&gt;, I kept all public access blocked.&lt;/p&gt;

&lt;p&gt;This is important because I wanted the S3 bucket to remain private and allow CloudFront to access the files instead.&lt;/p&gt;

&lt;p&gt;I then clicked:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create bucket&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshot
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp1ecucpu5qwn71ey8vg1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp1ecucpu5qwn71ey8vg1.png" alt=" " width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 2: Uploading Portfolio Files
&lt;/h1&gt;

&lt;p&gt;After creating the bucket, I opened it from the S3 bucket list.&lt;/p&gt;

&lt;p&gt;My portfolio contained files such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I selected:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upload → Add files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and uploaded my portfolio files.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;index.html&lt;/code&gt; file acts as the main page of the portfolio.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;style.css&lt;/code&gt; file contains the styling, while the &lt;code&gt;images&lt;/code&gt; folder contains images used by the website.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Creating a CloudFront Distribution
&lt;/h1&gt;

&lt;p&gt;After uploading the files, I created a CloudFront distribution.&lt;/p&gt;

&lt;p&gt;I opened:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Console → CloudFront&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and selected:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create distribution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;Origin domain&lt;/strong&gt;, I selected my S3 bucket.&lt;/p&gt;

&lt;p&gt;The origin points to the S3 bucket where my portfolio files are stored.&lt;/p&gt;

&lt;p&gt;The important point here is that I selected the &lt;strong&gt;S3 bucket origin&lt;/strong&gt;, not the S3 static website endpoint.&lt;/p&gt;

&lt;p&gt;This allows CloudFront to securely communicate with the S3 bucket.&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshot
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu3uwfti2glblv7gvawr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu3uwfti2glblv7gvawr3.png" alt=" " width="799" height="326"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4: Updating the S3 Bucket Policy
&lt;/h1&gt;

&lt;p&gt;After configuring OAC, CloudFront needs permission to read the objects from the S3 bucket.&lt;/p&gt;

&lt;p&gt;AWS provides a bucket policy for allowing the CloudFront distribution to access the bucket.&lt;/p&gt;

&lt;p&gt;I went to:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S3 → My Bucket → Permissions → Bucket Policy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The policy allows the CloudFront service to perform:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s3:GetObject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on the objects inside the bucket.&lt;/p&gt;

&lt;p&gt;The policy is associated with my specific CloudFront distribution.&lt;/p&gt;

&lt;p&gt;The general structure looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AllowCloudFrontServicePrincipalReadOnly"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cloudfront.amazonaws.com"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::YOUR-BUCKET-NAME/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"StringEquals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"AWS:SourceArn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:cloudfront::YOUR-AWS-ACCOUNT-ID:distribution/YOUR-DISTRIBUTION-ID"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I used the policy generated for my own CloudFront distribution rather than manually guessing the values.&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshot
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhu1c87ne8q3atr1jf4ht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhu1c87ne8q3atr1jf4ht.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 5: Setting &lt;code&gt;index.html&lt;/code&gt; as the Default Root Object
&lt;/h1&gt;

&lt;p&gt;The next step was configuring the default page of the CloudFront distribution.&lt;/p&gt;

&lt;p&gt;Inside the CloudFront distribution settings, I set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Default root object: index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful because users can simply visit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://my-cloudfront-domain/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://my-cloudfront-domain/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CloudFront automatically serves &lt;code&gt;index.html&lt;/code&gt; when the root URL is requested.&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshot
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg13nijlxtiinwfzuvlzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg13nijlxtiinwfzuvlzb.png" alt=" " width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 6: Deploying the CloudFront Distribution
&lt;/h1&gt;

&lt;p&gt;After completing the configuration, I created the CloudFront distribution.&lt;/p&gt;

&lt;p&gt;Initially, CloudFront may show a deployment status while AWS creates the distribution and applies the configuration.&lt;/p&gt;

&lt;p&gt;After deployment, the distribution becomes available.&lt;/p&gt;

&lt;p&gt;The CloudFront console provides a domain name similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;d2ze62elibenrh.cloudfront.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This domain can be used to access the portfolio.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 7: Testing the Portfolio
&lt;/h1&gt;

&lt;p&gt;After the CloudFront distribution was deployed, I opened the CloudFront URL in my browser.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://d1234567890abc.cloudfront.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The portfolio website was displayed successfully.&lt;/p&gt;

&lt;p&gt;The request flow was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   |
   v
CloudFront
   |
   v
S3
   |
   v
index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Screenshot
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4tgmmlgt2zyx8838y8ew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4tgmmlgt2zyx8838y8ew.png" alt=" " width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Use CloudFront?
&lt;/h1&gt;

&lt;p&gt;CloudFront is a Content Delivery Network (CDN).&lt;/p&gt;

&lt;p&gt;Instead of every user directly accessing the S3 bucket, CloudFront handles requests and delivers the content through its distributed infrastructure.&lt;/p&gt;

&lt;p&gt;This provides several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster content delivery&lt;/li&gt;
&lt;li&gt;HTTPS support&lt;/li&gt;
&lt;li&gt;Caching of static files&lt;/li&gt;
&lt;li&gt;Reduced load on the origin&lt;/li&gt;
&lt;li&gt;Better global performance&lt;/li&gt;
&lt;li&gt;Integration with AWS security features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a simple portfolio, the performance difference may not be dramatic, but the architecture is much more representative of a real cloud deployment.&lt;/p&gt;

&lt;h1&gt;
  
  
  What I Learned
&lt;/h1&gt;

&lt;p&gt;Through this project, I learned how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create and configure an Amazon S3 bucket.&lt;/li&gt;
&lt;li&gt;Upload static website files to S3.&lt;/li&gt;
&lt;li&gt;Create a CloudFront distribution.&lt;/li&gt;
&lt;li&gt;Configure an S3 origin for CloudFront.&lt;/li&gt;
&lt;li&gt;Configure Origin Access Control.&lt;/li&gt;
&lt;li&gt;Use an S3 bucket policy to allow CloudFront access.&lt;/li&gt;
&lt;li&gt;Configure &lt;code&gt;index.html&lt;/code&gt; as the default root object.&lt;/li&gt;
&lt;li&gt;Deploy and test a website using a CloudFront URL.&lt;/li&gt;
&lt;li&gt;Understand the difference between public S3 hosting and private S3 with CloudFront.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hosting a portfolio using S3 and CloudFront is a simple way to understand the basics of AWS cloud deployment.&lt;/p&gt;

&lt;p&gt;The main idea is straightforward:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S3 stores the website, CloudFront delivers it, and Origin Access Control keeps the S3 origin private.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project also helped me understand that cloud deployment is not only about getting a website online. Security, access control and how services communicate with each other are equally important.&lt;/p&gt;

&lt;p&gt;A small portfolio ended up being a useful introduction to real-world AWS architecture.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
