CodeDeploy Basics
- It is a service that automates code deployments and software deployments to any instance, including Amazon EC2 instances and instances running on-premises.
- Makes it easier for you to rapidly release new features
- Helps you avoid downtime during application deployment
- Handles the complexity of updating applications.
CodeDeploy Deployment Types
CodeDeploy provides two deployment type options:
- In-place deployment: The application on each instance in the deployment group stops, the latest application revision gets install, and the new version of the application start and validate.
- Blue/green deployment
- Blue/green on an EC2/On-Premises compute platform:
- The instances in a deployment group (the original environment) are replaced by a different set of instances (the replacement environment)
- Blue/green on an AWS Lambda compute platform:
- Traffic is shifted from current serverless environment to one with updated Lambda function versions.
- Blue/green on an Amazon ECS compute platform:
- Traffic shift from the task set with the original version of a containerized application in an Amazon ECS service to a replacement task set in the same service.
- Blue/green on an EC2/On-Premises compute platform:
Sample CodeDeploy in-place deployment
- First, create deployable content on local development machine or similar environment, and then you add an application specification file (AppSpec file). The AppSpec file is unique to CodeDeploy. It defines the deployment actions you want CodeDeploy to execute. You bundle deployable content and the AppSpec file into an archive file, and then upload it to an Amazon S3 bucket or a GitHub repository. This archive file is an application revision (or simply a revision).
- Provide CodeDeploy with information about deployment, such as which Amazon S3 bucket or GitHub repository to pull the revision from and to which set of Amazon EC2 instances to deploy its contents. CodeDeploy calls a set of Amazon EC2 instances a deployment group. A deployment group contains individually tagged Amazon EC2 instances, Amazon EC2 instances in Amazon EC2 Auto Scaling groups, or both.
- Each time you successfully upload a new application revision that you want to deploy to the deployment group, that bundle is set as the target revision for the deployment group. In other words, the application revision that currently targets for deployment is the target revision. This is also the revision that is pulling for automatic deployments.
- Next, the CodeDeploy agent on each instance polls CodeDeploy to determine what and when to pull from the specified Amazon S3 bucket or GitHub repository.
- Finally, the CodeDeploy agent on each instance pulls the target revision from the Amazon S3 bucket or GitHub repository and, using the instructions in the AppSpec file, deploys the contents to the instance.
AWS Certified DevOps Engineer Free Practice TestTake a Quiz