Logo

dev-resources.site

for different kinds of informations.

Continuous Cloning of CodeCommit Repo in Multiple Regions Using CodeBuild and CodePipeline

Published at
2/7/2023
Categories
codecommit
codebuild
codepipeline
aws
Author
bhatnagargargee
Author
15 person written this
bhatnagargargee
open
Continuous Cloning of CodeCommit Repo in Multiple Regions Using CodeBuild and CodePipeline

“ I have to make a continuous clone of the code commit repository in multiple regions. I have checked various ways to do it but it's easy to do using codebuild and codepipeline. Pricing of codebuild and codecommit depends on commit users and build project time taken.”

AWS CodeBuild is a fully managed build service. It compiles your source code, tests and produces artifacts that are ready to deploy. It eliminates the need to provision, scale and manage build servers. It provides prepackaged build environments for programming languages and build tools. Also build environments in codebuild to use your own build tools. Codebuild scales automatically to meet the peak build requests.

In this post, you will get to know how to do continuous cloning of codecommit repo in multiple regions using codebuild and codepipeline. Here I have created codecommit repo, codebuild, codepipeline and iam role with required permission policies.

Architecture Overview

Image description
The architecture diagram shows the overall deployment architecture with data flow, aws codecommit repo, aws codebuild, iam role and aws codepipeline.

Solution overview

The blog post consist of the following phases:

  1. Create of CodeCommit Repo, CodeBuild, CodePipeline and IAM Role
  2. Output as Source CodeCommit Repo Branches with Files to Destination CodeCommit Repo

Phase 1: Create of CodeCommit Repo, CodeBuild, CodePipeline and IAM Role

  1. Open the CodeCommit console and create a repository in two regions(N.Virginia and Oregon). Also create CodeBuild with clone script of clone and CodePipeline with commit and build stage. For permission on build, assign permission of commit repo of both region with git pull and push on build role. Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Phase 2: Output as Source CodeCommit Repo Branches with Files to Destination CodeCommit Repo

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Clean-up

Delete CodeCommit Repo, CodeBuild Project, CodePipeline, IAM Role and CloudWatch Log Group.

Pricing

I review the pricing and estimated cost of this example.

Cost of CodeBuild = Free Tier - 100 build minutes on build.general1.small = $0.0

Cost of CodeCommit = $0.00 for first 5 CodeCommit users = $0.0

Cost of CloudWatch = First 5GB per month of log data ingested is free = $0.0

Total Cost = $0.0

Summary

In this post, I showed “continuous cloning of codecommit repo in multiple regions using codebuild and codepipeline”.

For more details on AWS CodePipeline, Checkout Get started AWS CodePipeline, open the AWS CodePipeline console. To learn more, read the AWS CodePipeline documentation.

For more details on AWS CodeBuild, Checkout Get started AWS CodeBuild, open the AWS CodeBuild console. To learn more, read the AWS CodeBuild documentation.

Thanks for reading!

Connect with me: Linkedin
Image description

codepipeline Article's
30 articles in total
Favicon
Streamlining CI/CD with AWS CodePipeline and GitHub Actions: A DevOps Perspective
Favicon
New Free CI/CD Platform Enhances Mobile App Deployment: A Comprehensive Solution for Developers
Favicon
AWS CodePipeline introduces the Commands action that enables customer to easily run shell commands as part of pipeline execution
Favicon
AWS CodePipeline V2 type pipelines supports to automatically retry a stage if there is a failure in the stage.
Favicon
Automate Application Deployment to AWS Elastic Beanstalk with Terraform and CodePipeline
Favicon
Say Goodbye to Extra CodeBuild Projects: AWS CodePipeline’s New Commands Action Explained
Favicon
AWS CodePipeline V2 type pipelines introduces pipeline variable check rule
Favicon
Deploying Flutter Web to S3 with CodeCommit, Codepipeline, Codebuild, and CodeDeploy
Favicon
Update Github token in Codepipeline with Cloudformation
Favicon
Setting up CI/CD in AWS with CodeCommit, CodeDeploy, CodePipeline, ECR, and ECS
Favicon
Creating a Continuous Delivery Pipeline in AWS (Hands-On)
Favicon
Deploy NodeJS REST API on ECS Fargate using AWS CodePipeline
Favicon
Automatizando infraestructura tecnolĂłgica con DevOps
Favicon
Review of Elastic beanstalk, CodeDeploy, CodePipeline, CodeBuild
Favicon
Despliega tu Asistente de IA Generativa en AWS
Favicon
UI Devs on AWS Should Start with Amplify
Favicon
Blue-Green deployment with GitLab CI and CodePipeline on an AWS ECS cluster
Favicon
Part 1: Pipeline fun with AWS
Favicon
Extending CloudFormation's Power: Creating Custom Resources for Enhanced AWS Resource Management
Favicon
ÂżQue es la cultura DevOps?
Favicon
Receive Slack Notification of CodePipeline with SNS and Lambda
Favicon
Deploy S3 hosted application using CodePipeline
Favicon
Continuous Cloning of CodeCommit Repo in Multiple Regions Using CodeBuild and CodePipeline
Favicon
Cross account deployments using a Customer Managed KMS key
Favicon
3-part series - (3) Create a CodePipeline pipeline and deploy the application on the instance
Favicon
3-part series - (1) Launch an EC2 Instance, Install CodeDeploy Agent and upload App_Linux.zip file to version enabled S3 bucket
Favicon
6-part series - (5) Create a CodeBuild Project, upload the code and push it to the master repository
Favicon
6-part series - (4) Create, clone a CodeCommit Repo, move-push the Dockerfile and index.html to remote repository master branch
Favicon
Sexiest way to manage your AWS resources
Favicon
Building applications with pipelines

Featured ones: