Chandra Meets CodeDeploy: My First AWS Deployment Journey A developer documented using AWS CodeDeploy to automate application deployment for a college placement prediction project, describing how the fully managed service handles code, configuration, and scripts across EC2, Lambda, and ECS. The writeup covers the appspec.yml lifecycle hooks, in-place and blue/green deployment strategies, and automatic rollback triggered by CloudWatch alarms. Exploring how AWS CodeDeploy makes application deployment easier, faster, and more reliable. 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 deployment . 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. This is where AWS CodeDeploy 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. AWS CodeDeploy 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. CodeDeploy supports three major compute platforms: It can retrieve application revisions from sources such as Amazon S3 and supported source-code repositories, depending on the deployment platform. 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. 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. 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. At a high level, CodeDeploy follows a simple pattern: You store your application code in a source location GitHub, S3, or CodeCommit . You describe the deployment steps in a file called appspec.yml, which lives with your code. 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. If you've attached CloudWatch alarms, CodeDeploy watches them during the rollout and automatically rolls back if something looks unhealthy. Here's a simplified view of that flow: 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. Key Features 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. 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. 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. 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. College / Student Use Case 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. 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. Simple Example A minimal appspec.yml for deploying a small web app to EC2 looks like this: yaml version: 0.0 os: linux files: And triggering a deployment through the AWS CLI is just: bash aws deploy create-deployment \ --application-name student-demo-app \ --deployment-group-name demo-server-group \ --github-location repository=my-username/student-project,commitId= CodeDeploy then runs each hook script in order and reports success or failure in the console. 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. 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. CodeDeploy supports different deployment strategies. In-place deployment: The existing servers are updated with the new application version. The application may be stopped during the update, depending on the configuration. Blue/green deployment: 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. 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. 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. For example, a deployment may need to: These instructions can be stored in the AppSpec file and reused during future deployments. 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. 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. Consider a student team at a college developing a Placement Prediction Web Application . The project uses: 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. The team can use AWS CodeDeploy to automate the process. 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. 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. This approach helps students understand real-world DevOps practices, reduces repetitive manual work, and creates a more organized deployment workflow. Let us consider a basic Python Flask application deployed to an Ubuntu EC2 instance. my-flask-app/ │ ├── app.py ├── requirements.txt ├── appspec.yml └── scripts/ ├── install dependencies.sh └── start application.sh The app.py file contains a simple web application: python from flask import Flask app = Flask name @app.route "/" def home : return "Hello from AWS CodeDeploy " if name == " main ": app.run host="0.0.0.0", port=5000 The appspec.yml file tells CodeDeploy where to copy the application files and which scripts to execute. version: 0.0 os: linux files: - source: / destination: /home/ubuntu/my-flask-app hooks: AfterInstall: - location: scripts/install dependencies.sh timeout: 300 runas: ubuntu ApplicationStart: - location: scripts/start application.sh timeout: 300 runas: ubuntu The files section specifies the destination directory. The hooks section defines scripts that run after installation and when the application starts. The install dependencies.sh script can install the Python packages required by the application. bash /bin/bash cd /home/ubuntu/my-flask-app python3 -m pip install -r requirements.txt The start application.sh script can start the Flask application. bash /bin/bash cd /home/ubuntu/my-flask-app nohup python3 app.py app.log 2 &1 & These scripts are only a basic demonstration. In a production environment, a process manager such as systemd should normally be used instead of repeatedly starting background processes with nohup . The student team can follow these steps: The EC2 instance must have the necessary IAM permissions, and the CodeDeploy agent must be correctly installed and running. AWS CodeDeploy offers several advantages: Although CodeDeploy is useful, it is not a complete replacement for every DevOps tool. 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. 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. 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. 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. 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. 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. 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. 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. Chandra's takeaway: CodeDeploy helps turn the process of “I finished my code” into “My updated application is deployed and ready to use.” ☁️