Complex code development is impossible without the use version control system. The version control system enables the management of the codebase among multiple team members or within multiple teams too. AWS provides such service using its new service named CodeCommit which provides secure, highly available service with the hassle of management of repositories and underlying infrastructure. In one way, it is GitHub by AWS.
What is CodeCommit?
AWS CodeCommit is a version control service hosted by Amazon Web Services that you can use to privately store and manage assets (such as documents, source code, and binary files) in the cloud.
Why use CodeCommit?(Features of AWS CodeCommit)
- Highly Available: stores your code in amazon S3 and DynamoDB
- Security: transfer files to and from AWS CodeCommit using SSH and HTTPS protocols and also data is encrypted at rest using AWS KMS
- Monitoring: it manages users using IAM and monitor repositories using AWS CloudWatch and CloudTrail, also SNS services can be configured in order to receive SMS/Email notification for various events
- Fully Managed service
Alternatives to of Code commit
- Azure DevOps Server
How CodeCommit Works?
Let's dive in create your first CodeCommit repository from Scratch
How to create a CodeCommit repository?
Important Note: In order to create a repository you need to log in with user-created using IAM. You can not use the root user for the below steps.
- Login in AWS management Console and search for CodeCommit service
- In the CodeCommit service, select the ‘Create Repository button. After filling up the name and description, you can also enable the Amazon CodeGuru service to get an additional recommendation for your pull requests.
- We have successfully created repositories. Repositories are always empty when first created. Now we can transfer files, using 2 methods: SSH and HTTPS. For the demo, let us create one demo file and add it to the repository.
- We can create branches in order to create copies of the common code base which helps in parallel codebase development. In CodeCommit, first, commit is always stored in a branch named ‘main’. You can create new branches from other branches. Click on “Create Branch” and add details like branch name and from which branch you need to create a copy. (Parent branch)
- Once you create branches, you can individually work on copies and at the end, you can add changes to the parent branch. You can use a feature called “Pull Request” for this purpose. CodeCommit will let you know if those changes are mergeable or not. Also, it shows a summary of all differences and commits along with it.
- You can add various approvers for Pull requests for analyzing and reviewing changes before merging to the parent branch. This way puts quality measures on the codebase in the repository. Amazon CodeGuru also provides recommendations for the same. After review, you can merge those changes parent repository.
Hope you liked this article. Stay tuned for more articles related to AWS. Happy coding!