Explain AWS Codes: CodeCommit, CodePipeline, CodeBuild, and CodeDeploy

Explain AWS Codes: CodeCommit, CodePipeline, CodeBuild, and CodeDeploy

December 20, 2019 / Eternal Team

Extract Introduce 4 key services that can help to automate deployment processes and help to release your code in different stages. The Services can be used as stand-alone services as well as combined-integrated to configure-setup CI/CD for your Infrastructure.

These services help Developers to create pipelines of newly committed code and can then directly deploy it to their respective Instances without ever manually entering into the Servers.

Lets get introduced to all the respective services one by one and also get to know there significance and importance.

CodeCommit is a highly scalable, managed git based private repository maintaining Service. Basically it is an AWS branded version of Git with other features that can help you to make this service interact with other Services. CodeCommit is usable the same way you use GitHub for storing your Code with multiple branches and multiple commit timelines.

CodePipeline is a continuous delivery service that automates the building, testing and deployment of your software into production. CodePipeline can be configured to be triggered when there is a new commit in CodeCommit and then It will fully automate your release process from end to end, starting from taking your source repository through build, test and deployment stage. You can also prevent changes from moving through a pipeline by including a manual approval action in any stage except a Source stage.

CodeBuild is a Build creating service that builds your code so that it can be ready for Deployment and CodeBuild can be triggered by CodePipeline. The use of CodeBuild is not mandatory and can be omitted if your code does not need to be built. For e.g.:- html code does not need to be built but Angular Code needs to be built. So, usage of CodeBuild is totally dependent on your Personal requirements.

CodeDeploy is the service that deploys the code from CodeCommit after CodePipeline is triggered and the build has been created by CodeBuild. CodeDeploy can deploy your code on ec2 instance, s3 bucket, as well as inside Lambda functions. You can also opt-in for various types of Deployments specifically for ec2, ecs and lambda like.

  • In-place Deployment :- The Deployment will stop the application with running version of code on the ec2 Instance; latest version of the code will be pushed into the ec2 Instance and the application will be restarted to run with the latest version of code.
  • Blue/Green Deployment
    • On EC-2 Below the Load-Balancers; New Instances are launched and latest version of the code is uploaded in New Instances and then the existing instances are replaced with New Instances under the Load-Balancer.
    • On lambda Traffic is shifted from your current serverless environment to one with your updated Lambda function versions. You can specify Lambda functions that perform validation tests and choose the way in which the traffic shift occurs. All AWS Lambda compute platform deployments are blue/green deployments. For this reason, you do not need to specify a deployment type.
    • On ECS Traffic is shifted 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. The protocol and port of a specified load balancer listener is used to reroute production traffic. During a deployment, a test listener can be used to serve traffic to the replacement task set while validation tests are run.

In the above shown Image we have depicted a sample procedure of how a CI/CD may work on AWS.

  1. Developer makes changes in any Branch of his/her Repo existing in CodeCommit.
  2. Developer commits the code in that Branch as final Changes to the Repo.
  3. CodePipeline constantly monitors any changes that happen in Repo. and on detecting any change registers the change and initiates CodeBuild Service.
  4. CodeBuild Service Builds the version of code pointed to by CodePipeline and provides the Build to CodeDeploy.
  5. CodeDeploy Service will take the built code provided by CodeDeploy and deploy it on your resources that can be anything from ec2, s3, ecs to lambda as well.

CodeBuild process in this scenario is totally optional and depends on your code requirements whether your code requires build process or not like you don’t need CodeDeploy for html code changes but node, angular code needs a build process.

Again, this example is not comprehensive and can be tweaked by any user according to his/her personal requirements; like you can use Github as well as s3 Bucket instead of CodeCommit from where CodePipeline will monitor and initiate Processes on updates/changes in the existing code.

Conclusion CodeCommit, CodePipeline, CodeBuild and CodeDeploy services have been launched keeping in mind the pain points of Developers that they have experienced in establishing CI/CD and AWS has also made the services very much flexible and compatible with other Third-Party Repository Maintainers.

Want to start a project?

It’s simple.

Contact us