Skip to content
tezvyn:

AWS CodeDeploy: Automated, Safe Application Updates

Source: docs.aws.amazon.comMediumHow cards are made

AWS CodeDeploy: Automated, Safe Application Updates

AWS CodeDeploy automates pushing your application to servers, Lambda, or ECS. It handles complex updates across many targets, letting you release new features rapidly while minimizing downtime.

Why it exists

Manual deployments are risky, slow, and don't scale. A small error can cause major downtime, and coordinating updates across many servers is complex and error-prone. CodeDeploy was created to automate this process, making deployments faster, more reliable, and repeatable across one or thousands of targets.

The mental model

Think of CodeDeploy as a sophisticated deployment script runner with built-in safety nets. You provide the "what" (your application artifact) and the "how" (an AppSpec file with instructions), and CodeDeploy executes the rollout, monitors health, and can automatically roll back if things go wrong. It separates the act of deployment from the logic of your application.

How it works

You define an application and a deployment group (the target EC2 instances, Lambda functions, or ECS services). In your project's root, you create an AppSpec file. This file tells CodeDeploy which files to copy and what scripts to run at different lifecycle hooks, like BeforeInstall, ApplicationStart, or ValidateService. When you trigger a deployment, the CodeDeploy agent on each target pulls the new revision from a source like S3 or GitHub and executes the steps defined in the AppSpec file.

When to use it

Use CodeDeploy when you need to automate deployments to EC2 instances, on-premises servers, AWS Lambda, or Amazon ECS. It is ideal for implementing CI/CD pipelines, minimizing downtime via rolling or blue/green strategies, and getting centralized control and visibility into your deployment status and history.

When not to use it

Do not use CodeDeploy as a build server. It doesn't compile code or create artifacts; for that, you need a service like AWS CodeBuild or Jenkins. CodeDeploy's job starts after the build artifact is ready. For simple, single-instance projects where downtime is not a concern, it might be overkill.

One canonical example

A common use case is updating a web application on an EC2 Auto Scaling group. For an in-place deployment, CodeDeploy updates a few instances at a time. It takes them out of the load balancer, deploys the new code, runs health checks, and returns them to service before moving to the next batch. For a blue/green deployment, it provisions a whole new fleet of instances, deploys the new version, and then switches traffic over once you've validated it.

Interview question

What is the core responsibility of AWS CodeDeploy in an application's lifecycle?

  • a.Automating the process of deploying application revisions to target environments.Correct
  • b.Compiling source code and packaging it into deployable artifacts.
  • c.Orchestrating the entire software development lifecycle from commit to production.
  • d.Monitoring application performance and scaling resources based on demand.
Why?

CodeDeploy's primary function is to automate the deployment of application artifacts to various targets, as stated by 'automates pushing your application to servers'. It explicitly does not compile code or create artifacts, which is the role described in option B.

Just read this? Test yourself on what you have been reading.

Read the original → docs.aws.amazon.com

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on aws — each one lists the topics its interview covers.

See open roles