Understanding CodeDeploy

Understanding in-place deployments in AWS CodeDeploy

  • Working of in-place deployments:

    • Firstly, you get ready with source code to be deployed along with application-specific file i.e. appspec.yml file. This file contains details about deployment actions to be executed on CodeDeploy.

    • Next, You give information about deployment, a source which can be either Amazon S3 or Github repository from where the content can be pulled. then, target on which the content will be deployed i.e. group of EC2 instances bundled together and called Deployment groups.

    • Next, the CodeDeploy agent installed on EC2 instances calls the source code from Amazon S3 or GitHub repositories.

    • Finally, the CodeDeploy agent pulls the set of instructions specified in the appspec.yml file and deploys the contents to individually tagged EC2 instances, Amazon EC2 in Auto Scaling groups, or both.

Overview of a blue/green deployment in AWS CodeDeploy

  • Blue/green type of deployments helps you in minimizing deployment time while you update your application to the next version or make new changes in the source code.

  • To perform blue/green deployment with AWS CloudFormation, you can use CloudFormation templates for deployments or Blue/green deployment through CloudFormation.

  • Blue/green deployments on Lambda updates the code in three ways i.e. Canary, Linear, or All-at-once.

  • The same types of deployments are commended when using Amazon ECS for deployments using CodeDeploy.

  • When using blue/green deployment for EC2/On-premise compute platform, you tag those EC2 instances. Individual EC2 or Amazon EC2 Autoscaling group can be tagged.

  • Always make sure that your EC2 instances have an IAM role attached and CodeDeploy agent is running.

Components used for deployment on EC2 Instances/On-premise compute

  • One can ask questions like What to deploy, At what rate should we deploy, and where to deploy.

  • Following types of components are used when using CodeDeploy deployments for EC2 instances/On-premise compute:

    • Application revision

    • Deployment configuration

    • And, Deployment group. 

Deployment workflow on EC2 Instances/On-premise compute

  • The deployment of application revision happens in the below major steps