Intro to CodeDeploy
CodeDeploy is a service that helps developers automate software deployments. The service takes care of the complexity involved with safely deploying new software to application servers that are already running. It can do this in a controlled, fail-safe fashion that ensures deployments are completed successfully, or rolled back to a known working state.
The key features of the service are discussed next.
Automated Deployments
Deploying software to running servers can be difficult. If the servers are handling customer requests, how do you ensure that your software update doesn't disrupt the customer experience? This is where CodeDeploy comes into play. It provides the mechanics to deploy software, in a non-disruptive fashion, to target servers.
Integrated with AWS Services
Application deployments on AWS typically use a handful of key services to provide functionality such as load balancing, autoscaling, and monitoring. CodeDeploy can integrate with these AWS services to provide seamless application updates.
Language & Platform Agnostic
CodeDeploy has software agents that can work on Linux and Windows operating systems. It is also language agnostic so you can deploy applications of all types.
Integrated with Popular Tools
CodeDeploy can integrate with existing toolchains. The service has a number of integrations with tools like Jenkins, Git, and Consul. You can see a full list of integrations here.
Anatomy of CodeDeploy
There are several components that are involved in a CodeDeploy configuration. Take a moment to study the diagram below and read the review beneath it.
Source: \_[_AWS Documentation](https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html)
Development Machine
CodeDeploy exists to deploy software to servers. This software normally starts off on a developers workstation. Commonly this is in a software repository such as Git (but it doesn't have to be Git). The software package must include an AppSpec file (appspec.yml). This file includes a set of instructions that directs the actiosn taken by the CodeDeploy service.
AWS CodeDeploy
Before using CodeDeploy you need to define an Application and a Deployment Group. After those are created, you can then deploy revisions of your software using the service.
Amazon S3 or Github
The software to be deployed needs to be stored on either Amazon S3 or Github. When its stored on S3 it needs to be a .zip file that contains all of the source code and the appspec.yml file. If you're using Github, you simply provide the repo name and commit ID to be used.
Amazon EC2 (or On-prem)
CodeDeploy needs servers to deploy to. These servers can be EC2 instances, or on-premise servers. The servers need to have the CodeDeploy agent installed.