In this video, Jeff Winesett covers AWS CodeDeploy. CodeDeploy is a application deployment component services on AWS. CodeDeploy helps with automating and scaling application deployment processes.
- [Instructor] Sometimes, all that is needed is the right, specific tool for the job. No more, and no less. When the job is nothing more than getting an application deployed to EC2 instances on AWS, CodeDeploy just may be the perfect fit. AWS CodeDeploy is not a fully managed application service like Elastic Beanstalk or OpsWorks, but rather what is sometimes referred to as a component service. It's more like a specific developer tool that AWS offers.
CodeDeploy is a service that coordinates application deployment across Amazon EC2 instances. CodeDeploy is not stack or language dependent and is built to work with any existing application files and deployment scripts. The service scales with AWS infrastructure and can be used to deploy to just one or many EC2 instances. One of the advantages to using CodeDeploy is that it's easy to adopt.
If a team already has a defined deployment process, and needs to simply get that working within AWS, CodeDeploy may be a great place to start. Or perhaps scripts are already written to handle deployment of an application to a single EC2 instance on AWS, and now that process needs to scale out to many instances. CodeDeploy can help here too. At the core of CodeDeploy is the concept of the application to be deployed. Applications within CodeDeploy have different revisions.
The specific revision is specified for each deployment. A revision is just a specific version of the application, including things like the source code files, or a compiled binary, and all other needed assets. These revisions can be stored in GitHub, or in an AWS S3bucket. The application revision answers the question, "What should be deployed?" The question "How the application should be deployed?" also needs to be answered.
A deployment configuration is the specification that outlines exactly how a deployment should proceed to a defined deployment group. The question "Where to deploy?" Must also be answered. These are defined as deployment groups, a deployment group is an EC2 instance, or set of instances, to which the application should be deployed. Instances can be added to a deployment group by specifying a tag identifier or an auto scaling group name.
So, CodeDeploy is told what to deploy by specifying an application revision, how to deploy by specifying a deployment configuration, and where to deploy by specifying the deployment group. CodeDeploy uses a single configuration file specifically named "AppSpec" to specify how to deploy the application. This is an example AppSpec file. It can be used to map files in the application to their host destination.
It is also used to specify commands that need to be run during the deployment process and at which specific phases in the deployment process these need to be run. CodeDeploy specifies several deployment lifecycle events that can be used to execute commands at different phases. This way, different commands can run at different times, allowing commands to run in a specific order, and according to which specific instance resources may be available.
Things such as starting an existing application or server, installing needed dependencies before starting, or performing any needed cleanup after installing. Putting this all together, here's the CodeDeploy flow. First, the application is coded and an App Spec file is created. Then, the application bundle including all files, assets, and the app file, are stored to S3 or GitHub. Then, the CodeDeploy service itself is configured, specifying an application revision and deployment group.
CodeDeploy will take care of creating and starting new instances if not already created to ensure the CodeDeploy agent is running on them. These agents then pull CodeDeploy to determine what revision should be deployed. When the agent determines a new revision has been specified for deployment, it grabs all the application files and executes all of the steps outlined in the App Spec file that is part of the application revision. Implementing elasticity rule number six, When dealing with an existing application, with existing steps or scripts for deployment, consider using CodeDeploy as a straightforward method to allow that application to take advantage of elasticity in the cloud.
- Benefits of cloud services
- Making architectures scalable
- Examining cloud constraints
- Virtual servers, EC2, and Elastic IP
- Using the Amazon machine image
- Elastic load balancing
- Using CloudWatch for monitoring
- Security Models
- Elastic block storage
- S3, CloudFront, and Elastic Beanstalk
- Handling queues, workflows, and notifications
- Caching options and services
- Identity and access management
- Creating a custom server image
- Application deployment strategies
- Serverless architectures