We announced AWS CodeCommit last November (see New AWS Tools for Code Management and Deployment) at AWS re:Invent. I am happy to announce that it is now generally available and that you can start using it today.
Let’s do a quick refresh on the CodeCommit feature set before taking the service for a spin.
CodeCommit is a managed revision control service that hosts Git repositories and works with existing Git-based tools. Files are organized in to repositories, with no limits on repository size or file count. As you’ll soon see, your existing Git skills, tools, and practices remain applicable.
Behind the scenes, CodeCommit implements Git in a scalable, redundant, and durable fashion so that your code and other assets will be safe and accessible. CodeCommit stores your files in encrypted repositories and uses IAM roles to control developer and administrative access. All data that moves to and from your development environment goes across HTTPS or SSH connections.
CodeCommit runs in the AWS Cloud and is a great fit for situations where your development team works from multiple locations or when you need to collaborate with vendors or other partners.
Here’s what some of our early users had to say about CodeCommit:
CodeCommit in Action
In order to gain some real-world experience with CodeCommit, I decided to create a mirror of the AWS SDK for PHP repository. I started out with a fresh EC2 instance running the Amazon Linux AMI. I installed the newest version of the AWS Command Line Interface (CLI), set up my credentials, and installed Git in the usual way:
$ sudo yum install git
I also configured my Git identity:
$ git config --global user.name "Jeff Barr" $ git config --global user.email [email protected]
I configured my AWS CLI to reference IAM user awscli by default. I gave this user permission to perform administrative actions on my CodeCommit repositories by attaching the AWSCodeCommitFullAccess policy:
This policy, as the name implies, allows me to perform all of the CodeCommit operations on all of my repositories. In a real-world environment, a more restrictive set of permissions would be more appropriate. For example, you might want to allow only certain senior developers to create and delete repositories.
Then I configured Git so that it could authenticate itself to CodeCommit. I instructed it to use a credential helper as follows:
$ git config --global credential.helper '!aws codecommit credential-helper [email protected]' $ git config --global credential.UseHttpPath true
Because the credential helper is supplied as part of the
aws command, the Git configuration setting can include a reference to any of the profiles that I have configured for use with the CLI. This option would be helpful if I was working on several projects in distinct repositories, each with individual credentials. In that case I would set the credential.helper on a per-repo basis like this:
$ cd repo1 $ git config --local credential.helper '!aws codecommit --profile jb_repo1 credential-helper [email protected]' $ cd ../repo2 $ git config --local credential.helper '!aws codecommit --profile jb_repo2 credential-helper [email protected]'
With Git configured, I created my repository using the Console (I could have used the CLI’s
create-repository command as well):
My repository was available for use right away! My CodeCommit Dashboard allowed me to see all of my repositories at a glance:
I was ready to add some content to the AWS_PHP_SDK repo, so I clicked on the URL icon and captured the HTTPS URL (the SSL URL is also available via the icon):
Then I cloned a copy of the SDK and pushed it to my repo:
$ git push https://git-codecommit.us-east-1.amazonaws.com/v1/repos/AWS_PHP_SDK --all Counting objects: 28690, done. Delta compression using up to 2 threads. Compressing objects: 100% (9608/9608), done. Writing objects: 100% (28690/28690), 12.91 MiB | 625.00 KiB/s, done.544.00 KiB/s Total 28690 (delta 16604), reused 28686 (delta 16603) To https://git-codecommit.us-east-1.amazonaws.com/v1/repos/AWS_PHP_SDK * [new branch] 2.8 -> 2.8 * [new branch] master -> master
I was about to learn more about my repo via the Console:
I also had the option to rename the repo and to adjust other settings:
CodeCommit is available now and you can start using it today!
You will be charged $1 per active user (defined as a unique IAM user or role, a federated user, or the root account) per month. You can store as many Git repositories as you’d like.
Each user comes with an allowance of 10 GB of storage and 2,000 Git requests (a push or pull that transmits repository objects) per month, all pooled across the users with each AWS account. Additional storage costs $0.06 per GB per month; additional requests are $0.001 each.
As part of the AWS Free Tier, new and existing customers can benefit from 5 active users, 50 GB of storage, and 10,000 Git requests per month at no charge.
In the Works
We have big plans for CodeCommit! Here are some of the things that we are working on next:
- Post-Receive Hooks – You will be able to have CodeCommit call external systems after each push to a repository. This will allow you to do things like notify a Continuous Integration (CI) server that new code is ready to be built and tested.
- CloudTrail Support – Your calls to the CodeCommit API will be recorded and available for auditing.
- More Regions – We are launching in the US East (Northern Virginia) region today. We plan to expand to additional regions over time.
- Additional UI Features – We are working to build out a complete web-based UI for your source code repositories.