{"id":4392,"date":"2020-10-27T16:10:37","date_gmt":"2020-10-27T10:40:37","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/?p=4392"},"modified":"2025-11-20T18:38:25","modified_gmt":"2025-11-20T13:08:25","slug":"how-to-implement-ci-cd-using-aws-codebuild-codedeploy-and-codepipeline","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2020\/10\/27\/how-to-implement-ci-cd-using-aws-codebuild-codedeploy-and-codepipeline\/","title":{"rendered":"How to implement CI\/CD using AWS CodeBuild, CodeDeploy and CodePipeline"},"content":{"rendered":"\r\n<p>As we know that <strong>CI\/CD<\/strong> (<strong>Continuous Integration\/Continuous Deployment<\/strong>) is inevitable process in our <strong>DevOps<\/strong> culture , we should always look for a better .. more efficient solution to implement the same.<\/p>\r\n\r\n\r\n\r\n<p><strong>CI\/CD<\/strong> gives us the capability to continuously integrate code changes, test it , deploy it and having<strong> continuous feedback<\/strong> which helps us to accelerate our development speed , off-course it reduces time in testing perspective and it helps you to make your <strong>releases streamline<\/strong>.<\/p>\r\n\r\n\r\n\r\n<p>So you dont have to worry about anything except <strong>CODING<\/strong> as <strong>CI\/CD<\/strong> will take care of everything for you. \ud83d\ude42<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-embed aligncenter is-type-rich is-provider-embed wp-block-embed-embed\">\r\n<div class=\"wp-block-embed__wrapper\">https:\/\/media.giphy.com\/media\/B1uajA01vvL91Urtsp\/source.gif<\/div>\r\n<\/figure>\r\n\r\n\r\n\r\n<p><!--more--><\/p>\r\n\r\n\r\n\r\n<p>There are lot of tools in market which helps you to implement CI\/CD . ..Well I was using &#8220;<strong>Jenkins<\/strong>&#8221; as a<strong> CI\/CD<\/strong> tool which I guess is the best open-source tool that I have ever known \ud83d\ude42 .<\/p>\r\n\r\n\r\n\r\n<p>But Today, we will talk about some other good alternatives : <strong>AWS CodeBuild , CodeDeploy and CodePipeline <\/strong>and its benefits over other available tools in market.<\/p>\r\n\r\n\r\n\r\n<p>In this blog, I will explain about the process to implement CI\/CD step by step via above mentioned AWS services.<\/p>\r\n\r\n\r\n\r\n<p>Here, we will deploy a sample <strong>Java application<\/strong> <a href=\"https:\/\/github.com\/opstree\/spring3hibernate\" target=\"_blank\" rel=\"noreferrer noopener\">spring3hibernate<\/a> in Ec2 servers which is behind an <strong>Application load Balancer<\/strong> using <strong>rolling deployment strategy.<\/strong><\/p>\r\n\r\n\r\n\r\n<p style=\"font-size: 22px; line-height: 1.8;\"><strong><em>STEP -1 Create a CodeBuild Project<\/em><\/strong><\/p>\r\n\r\n\r\n\r\n<p>We will use <strong>CodeBuild project<\/strong> to test and build the above sample Java app and prepares the <strong>artifact<\/strong> (<strong>WAR<\/strong> file) which we will use it later for deployment.<\/p>\r\n\r\n\r\n\r\n<p>Search CodeBuild service in AWS console navigation panel and then click on <strong>Create Build project<\/strong>.<\/p>\r\n\r\n\r\n\r\n<p>As you can see below, we need to fill out <strong>CodeBuild Project Configuration. <\/strong>Mention <strong>Project<\/strong> <strong>Name<\/strong> , <strong>Description<\/strong> with some <strong>Tags<\/strong> as per your choice.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2492\" height=\"1834\" class=\"wp-image-4510\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-17.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Then next part is <strong>Source<\/strong>. This section will describe the source provider from where <strong>CodeBuild<\/strong> will fetch your source code.<\/p>\r\n\r\n\r\n\r\n<p>It can be <strong>CODECOMMIT<\/strong> | <strong>CODEPIPELINE<\/strong> | <strong>GITHUB<\/strong> | <strong>S3<\/strong> | <strong>BITBUCKET<\/strong> | <strong>GITHUB_ENTERPRISE<\/strong> | <strong>NO_SOURCE<\/strong><\/p>\r\n\r\n\r\n\r\n<p>In our case it&#8217;s <strong>S3<\/strong>. We will store our source code as a zip in s3 bucket spring3-hibernate-app-bucket. Mention s3 object key as well and that will be the name of source code file that you have uploaded in s3 bucket.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2492\" height=\"976\" class=\"wp-image-4514\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-19.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Next step is to define <strong>Environment<\/strong> on which <strong>CodeBuild<\/strong> project will run. You can use <strong><a href=\"https:\/\/opstree.com\/application-modernization-with-aws\/\" target=\"_blank\" rel=\"noopener\">AWS Managed<\/a> Image<\/strong> or your <strong>Custom Image<\/strong> from <strong>ECR<\/strong>. For simplicity I am using AWS managed image here as Amazon Linux 2 OS.<\/p>\r\n\r\n\r\n\r\n<p>Then you need to select <strong>Service Role<\/strong>. <strong>AWS<\/strong> by default provides you a new service role which will give your <strong>CodeBuild<\/strong> project access to <strong>S3<\/strong> , <strong>CloudWatch<\/strong> logs etc as per your configuration.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2492\" height=\"1768\" class=\"wp-image-4517\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-20.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Select the compute size of <strong>CodeBuild<\/strong> project as per the requirement. In our case <strong>3 GB memory<\/strong> would be enough.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2492\" height=\"1768\" class=\"wp-image-4518\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-21.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p>Now the main part comes which is <strong>BuildSpec<\/strong>. Here you need to specifiy what commands you want to run to build your application. So there are two options to do the same :<\/p>\r\n\r\n\r\n\r\n<p><strong>Use a Buildspec file<\/strong> : You need to include this file (by default <strong>buildspec.yml <\/strong>filename) in root directory of your source code. (This is what we will do in next step).<\/p>\r\n\r\n\r\n\r\n<p><strong>OR<\/strong><\/p>\r\n\r\n\r\n\r\n<p><strong>Insert Build commands<\/strong>: You can simply enter commands in the console that you want to run.<\/p>\r\n\r\n\r\n\r\n<p>You can use below content to prepare your buildspec.yml file and place it in root directory of your source code.<\/p>\r\n\r\n\r\n\r\n<p>The first phase <strong>&#8220;Build&#8221;<\/strong> will run<strong> mvn test <\/strong>and if it passes, then the second phase <strong>&#8220;Post_Build&#8221; <\/strong>will get triggered and it will execute mvn package command which will generate a <strong>WAR<\/strong> file. And then we specify <strong>Artifacts<\/strong> name that will get stored in S3 bucket. Change the name of the <strong>WAR<\/strong> file according to you. I have mentioned <strong>appspec.yml<\/strong> file as an artifact which I will explain later about its significance.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-verse has-text-align-center\"><span class=\"has-inline-color\" style=\"color: #007acc;\">version: 0.2\r\nphases:\r\n  build:\r\n    commands:\r\n      - echo Build started on `date` \r\n      - mvn test \r\n  post_build: \r\n    commands: \r\n      - echo Build completed on `date` \r\n      - mvn package\r\nartifacts: \r\n  files:\r\n    - appspec.yml\r\n    - target\/Spring3HibernateApp.war\r\n  discard-paths: yes<\/span><\/pre>\r\n\r\n\r\n\r\n<p>Select <strong>Use a Buildspec file<\/strong> option and move on to <strong>Artifacts<\/strong> section where we will specify where we need to store project&#8217;s final <strong>artifacts<\/strong>. I am storing in same <strong>Source S3 <\/strong>bucket<strong> (spring3-hibernate-app-bucket)<\/strong> and selected Zip option to compress the artifacts.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2492\" height=\"1784\" class=\"wp-image-4520\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-22.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>And here comes the last part of Creating a CodeBuild project <strong>&#8220;LOGS&#8221;<\/strong>. This is an optional parameter. If you want to see logs of CodeBuild project execution , you need to select atleast one of the option <strong>(Cloudwatch \/ S3) <\/strong>.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2492\" height=\"782\" class=\"wp-image-4522\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-23.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Congratulations \ud83d\ude42 you just created your <strong>CodeBuild<\/strong> project. So Now lets jump onto <strong>CodeDeploy<\/strong> part but before that we need to do one thing:<\/p>\r\n\r\n\r\n\r\n<p>Place this <strong>appspec.yml<\/strong> file in the root directory of your source code. Here we are just specifying where our source code will be deployed in server (I mean in which location inside target server. ) In our case we are using <strong>tomcat<\/strong> for serving our application. So we are placing zip source code in <strong>\/var\/lib\/tomcat7\/webapps\/ <\/strong>oath.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-verse\"><span class=\"has-inline-color\" style=\"color: #007acc;\">version: 0.0\r\nos: linux\r\n\r\nfiles: \r\n  - source: \/ destination: \/var\/lib\/tomcat7\/webapps\/\r\n\r\npermissions: \r\n  - object: \/ \r\n    pattern: \"**\" \r\n    owner: tomcat \r\n    group: tomcat\r\n\r\n<\/span><\/pre>\r\n\r\n\r\n\r\n<p>For more info on <strong>Codebuild<\/strong> project , refer AWS docs <a href=\"https:\/\/docs.aws.amazon.com\/codebuild\/latest\/userguide\/welcome.html\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.aws.amazon.com\/codebuild\/latest\/userguide\/welcome.html<\/a><\/p>\r\n\r\n\r\n\r\n<p style=\"font-size: 22px; line-height: 1.8;\"><strong><em>STEP -2 Create CodeDeploy App<\/em><\/strong><\/p>\r\n\r\n\r\n\r\n<p>We will use <strong>Codedeploy<\/strong> service to fetch latest <strong>build<\/strong> <strong>artifact<\/strong> and deploy it to the target instances one by one. But to make it work , you need to install <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/codedeploy-agent-operations-install-cli.html\" target=\"_blank\" rel=\"noopener\"><strong>codedeploy<\/strong>&#8211;<strong>agent<\/strong> <\/a>in your Ec2 machines .<\/p>\r\n\r\n\r\n\r\n<p>So Navigate to CodeDeploy service and click on <strong>Create Application<\/strong>. Mention <strong>CodeDeploy<\/strong> app name and select <strong>Ec2\/On-premises<\/strong> as a Compute platform as we will be deploying app in Ec2. And then click on <strong>Create Application<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2492\" height=\"782\" class=\"wp-image-4524\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-24.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Now we need to create a <strong>deployment group <\/strong>which will define on which instances it will deploy <strong>artifatcs<\/strong>.<\/p>\r\n\r\n\r\n\r\n<p>Click on <strong>Create Deployment Group<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2696\" height=\"1134\" class=\"wp-image-4526\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-25.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p><br \/>Mention <strong>deployment group<\/strong> name. After that provide <strong>Service role Arn<\/strong>. You can create a service role in IAM with <a href=\"https:\/\/console.aws.amazon.com\/iam\/home?region=ap-southeast-1#\/policies\/arn%3Aaws%3Aiam%3A%3Aaws%3Apolicy%2Fservice-role%2FAWSCodeDeployRole\" target=\"_blank\" rel=\"noopener\">AWSCodeDeployRole<\/a> IAM policy attach and add <strong>codedeploy service<\/strong> as a Trust entity.<\/p>\r\n\r\n\r\n\r\n<p>And then you need to specify the type of deployment you need to do .. either <strong>IN-PLACE<\/strong> or <strong>BLUE\/GREEN<\/strong>. In this blog we will be using <strong>In-place deployment.<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"2082\" height=\"1624\" class=\"wp-image-4528\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-26.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>Now Select<strong><a href=\"https:\/\/opstree.com\/blog\/2024\/11\/19\/restoring-a-backup-stored-in-s3-to-an-ec2-instance-using-xtrabackup\/\" target=\"_blank\" rel=\"noopener\"> Amazon<\/a> Ec2 instance<\/strong> in <strong>Environment Configuration<\/strong> and then we need provide tags . On the basis of tags provided <strong>CodeDeploy<\/strong> will fetch target instances. In my case I gave tag <strong>app:spring3hibernate<\/strong> and <strong>env:prod<\/strong> . So whichever <strong>Ec2<\/strong> servers having such tags on them , <strong>CodeDeploy<\/strong> will deploy <strong>artifacts<\/strong> in them.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2318\" height=\"1214\" class=\"wp-image-4530\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-27.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>Now if you have already installed <strong>code-deploy agent<\/strong> in your <strong>Ec2<\/strong> servers, select Never option .. otherwise select other option so that <strong>System manager <\/strong>automatically install this agent in your target servers.<\/p>\r\n\r\n\r\n\r\n<p>In Deployment settings section, select <strong>CodeDeployDefaultOneAtATime<\/strong> which is CodeDeploy inbuilt deployment configuration . You can create custom one too.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2318\" height=\"1134\" class=\"wp-image-4535\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-29.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>So in last part of <strong>CodeDeploy<\/strong> , we need tell <strong>CodeDeploy<\/strong> about the <strong>Load Balancer <\/strong>and the target group under which the target instances are attached, so that at the time of deployment <strong>Load balancer<\/strong> will block all traffic from each target server.<\/p>\r\n\r\n\r\n\r\n<p><strong>NOTE: <\/strong>Uncheck <strong>Enable Load Balancing<\/strong> in case you dont have target servers under <strong>load balancer<\/strong>.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2318\" height=\"1048\" class=\"wp-image-4537\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-30.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>For more info on <strong>CodeDeploy<\/strong>, refer AWS docs <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/welcome.html\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/welcome.html<\/a><\/p>\r\n\r\n\r\n\r\n<p style=\"font-size: 22px; line-height: 1.8;\"><em>STEP-3 Create CodePipeline <\/em><\/p>\r\n\r\n\r\n\r\n<p>So Far we have created a <strong>CodeBuild<\/strong> project (which will test and build the artifact from java app) and a <strong>CodeDeploy<\/strong> application which will deploy the build artifact generated by <strong>CodeBuild<\/strong> project. But we need some tool which will integrate both services together and Thats where CodePipeline will help us \ud83d\ude42<\/p>\r\n\r\n\r\n\r\n<p>Click on <strong>Create Pipeline <\/strong>under <strong>CodePipeline<\/strong> service<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"468\" class=\"wp-image-4539\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-31.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p>Enter <strong>Pipeline name<\/strong> and select <strong>New Service Role<\/strong>. In Advanced settings, select custom s3 Location for <strong>artifact<\/strong> store.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"1808\" class=\"wp-image-4541\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-32.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p>Now we need to add <strong>Source stage<\/strong> which will act like a trigger for <strong>Codepipeline<\/strong> execution . So whenever there will be some changes in source, <strong>CodePipeline<\/strong> will start execution .<\/p>\r\n\r\n\r\n\r\n<p>Select <strong>Source provider<\/strong> as <strong>S3<\/strong> and specify bucket name where your source code will be stored.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"1208\" class=\"wp-image-4544\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-33.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p>And now for <strong>Build<\/strong> <strong>stage<\/strong> , we will use the same <strong>CodeBuild<\/strong> project <strong>&#8220;build-spring3hibernate-app&#8221;<\/strong> that we have created above.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"1340\" class=\"wp-image-4545\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-34.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>And the last part would be the deploy stage and will specify CodeDeploy project <strong>&#8220;deploy-spring3hibernate-app&#8221;<\/strong> which we have configured earlier.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"1148\" class=\"wp-image-4546\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-35.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>Review and click on <strong>Create Pipeline <\/strong><\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"1148\" class=\"wp-image-4547\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-36.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>For more info on <strong>CodePipeline<\/strong>, refer AWS docs <a href=\"https:\/\/docs.aws.amazon.com\/codepipeline\/latest\/userguide\/welcome.html\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.aws.amazon.com\/codepipeline\/latest\/userguide\/welcome.html<\/a><\/p>\r\n\r\n\r\n\r\n<p style=\"font-size: 22px; line-height: 1.8;\"><strong><em>Step-4 Trigger CodePipeline <\/em><\/strong><\/p>\r\n\r\n\r\n\r\n<p>Now we just need to trigger our CodePipeline by uploading our source code zip file in s3 bucket.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"950\" class=\"wp-image-4653\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-49.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>You have done enough now . It&#8217;s time to <strong>SIT AND RELAX<\/strong> . &#8230;.. \ud83d\ude42<\/p>\r\n\r\n\r\n\t<div class=\"wp-block-jetpack-gif aligncenter\">\n\t\t<figure>\n\t\t\t\t\t\t\t<div class=\"wp-block-jetpack-gif-wrapper\" style=\"padding-top:55%\">\n\t\t\t\t\t<iframe src=\"https:\/\/giphy.com\/embed\/7zrZAg66QEd6K8cA7x\" title=\"https:\/\/media.giphy.com\/media\/7zrZAg66QEd6K8cA7x\/giphy.gif\"><\/iframe>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/figure>\n\t<\/div>\n\t\r\n\r\n\r\n<p>So <strong>CodePipeline<\/strong> triggered and also completed successfully. <strong>CodePipeline<\/strong> provides <strong>visualisation<\/strong> for us. So in CodePipeline we can see the execution status of each stage in a <strong>centralised<\/strong> place.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image is-style-default\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"1862\" class=\"wp-image-4652\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/image-48.png?w=1024\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>Lets test it whether our code is deployed properly or not by simply hitting ALB DNS.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"3194\" height=\"700\" class=\"wp-image-4655\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/10\/screenshot-2020-10-15-at-10.28.21-pm.png?w=1024\" alt=\"\" \/><\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\t<div class=\"wp-block-jetpack-gif aligncenter\">\n\t\t<figure>\n\t\t\t\t\t\t\t<div class=\"wp-block-jetpack-gif-wrapper\" style=\"padding-top:56%\">\n\t\t\t\t\t<iframe src=\"https:\/\/giphy.com\/embed\/lMVNl6XxTvXgs\" title=\"we did it\"><\/iframe>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t<figcaption class=\"wp-block-jetpack-gif-caption gallery-caption\"><strong>YEHHHHHH!!!.<\/strong>. We did it .. \ud83d\ude42<\/figcaption>\n\t\t\t\t\t<\/figure>\n\t<\/div>\n\t\r\n<div class=\"wp-block-group\">\r\n<div class=\"wp-block-group__inner-container\">\r\n<div class=\"wp-block-group\">\r\n<div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\r\n<p>The beauty of this service is that it mostly take care of everything .. eg:<\/p>\r\n\r\n\r\n\r\n<ol>\r\n<li>You dont need to manage any servers.<\/li>\r\n<li>You dont have to write logic for blue-green or rolling deployment in AWS. <strong>CodeBuild<\/strong> has predefined <strong>deployment configurations<\/strong> which we can simply use it.<\/li>\r\n<li>It&#8217;s <strong>highly<\/strong> <strong>scalable<\/strong> . So no build needs to wait for other <strong>builds<\/strong> to complete. we can run as many builds concurrently.<\/li>\r\n<li><strong>Pay as you go<\/strong> : With AWS CodeBuild, you are charged based on the number of minutes it takes to complete your build. This means you no longer have to worry about paying for idle build server capacity.<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<p id=\"465e\">So I hope that now you got some idea how <strong>CodeBuild , CodeDeploy and CodePipeline<\/strong> can help us in CI\/CD process. So if you dont want to take headache of managing packages and server and builds , then these services would be right option for you.<\/p>\r\n\r\n\r\n\r\n<p>There are lot of other things that we can do , specifically in <strong>buildspec<\/strong> and <strong>appspec.yml <\/strong>file which I will cover in different blog. Just wanted to explain simple flow of CI\/CD in this blog.<\/p>\r\n\r\n\r\n\r\n<p id=\"8e05\">Thanks for reading, I\u2019d really appreciate the feedback. So, please leave your comment below if you guys have any queries related to this blog.<\/p>\r\n\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<p><strong>Related Searches &#8211; <a href=\"https:\/\/opstree.com\/aws-partner\/\" target=\"_blank\" rel=\"noopener\">AWS Partner<\/a> | <a href=\"https:\/\/opstree.com\/services\/cloud-engineering-services\/\" target=\"_blank\" rel=\"noopener\">Cloud Engineering Services<\/a>\u00a0<\/strong><\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\r\n<div class=\"wp-block-group__inner-container\"><!-- wp:group -->\r\n<div class=\"wp-block-group\">\r\n<div class=\"wp-block-group__inner-container\"><!-- wp:paragraph -->\r\n<p>The beauty of this service is that it mostly take care of everything .. eg:<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:list {\"ordered\":true} -->\r\n<ol>\r\n<li>You dont need to manage any servers.<\/li>\r\n<li>You dont have to write logic for blue-green or rolling deployment in AWS. <strong>CodeBuild<\/strong> has predefined <strong>deployment configurations<\/strong> which we can simply use it.<\/li>\r\n<li>It&#8217;s <strong>highly<\/strong> <strong>scalable<\/strong> . So no build needs to wait for other <strong>builds<\/strong> to complete. we can run as many builds concurrently.<\/li>\r\n<li><strong>Pay as you go<\/strong> : With AWS CodeBuild, you are charged based on the number of minutes it takes to complete your build. This means you no longer have to worry about paying for idle build server capacity.<\/li>\r\n<\/ol>\r\n<!-- \/wp:list -->\r\n\r\n<!-- wp:paragraph -->\r\n<p id=\"465e\">So I hope that now you got some idea how <strong>CodeBuild , CodeDeploy and CodePipeline<\/strong> can help us in CI\/CD process. So if you dont want to take headache of managing packages and server and builds , then these services would be right option for you.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>There are lot of other things that we can do , specifically in <strong>buildspec<\/strong> and <strong>appspec.yml <\/strong>file which I will cover in different blog. Just wanted to explain simple flow of CI\/CD in this blog.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph -->\r\n<p id=\"8e05\">Thanks for reading, I\u2019d really appreciate the feedback. So, please leave your comment below if you guys have any queries related to this blog.<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:paragraph --><\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<p><strong>Related Searches &#8211; <a href=\"https:\/\/opstree.com\/aws-partner\/\" target=\"_blank\" rel=\"noopener\">AWS Partner<\/a> | <a href=\"https:\/\/opstree.com\/services\/cloud-engineering-services\/\" target=\"_blank\" rel=\"noopener\">Cloud Engineering Services<\/a>\u00a0<\/strong><\/p>\r\n<!-- \/wp:paragraph -->","protected":false},"excerpt":{"rendered":"<p>As we know that CI\/CD (Continuous Integration\/Continuous Deployment) is inevitable process in our DevOps culture , we should always look for a better .. more efficient solution to implement the same. CI\/CD gives us the capability to continuously integrate code changes, test it , deploy it and having continuous feedback which helps us to accelerate &hellip; <a href=\"https:\/\/opstree.com\/blog\/2020\/10\/27\/how-to-implement-ci-cd-using-aws-codebuild-codedeploy-and-codepipeline\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to implement CI\/CD using AWS CodeBuild, CodeDeploy and CodePipeline&#8221;<\/span><\/a><\/p>\n","protected":false},"author":192214992,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474],"tags":[768739294,650329345,241804857,303547101,376111894,768739308],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-18Q","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/4392"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/192214992"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=4392"}],"version-history":[{"count":27,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/4392\/revisions"}],"predecessor-version":[{"id":29962,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/4392\/revisions\/29962"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=4392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=4392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=4392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}