Hosting your code on AWS CodeCommit

It's pretty easy nowadays to host your code over the cloud platforms, it's no rocket science nor a hard-to-do task but you need to be aware of certain steps to avoid troubleshooting for a couple of hours. Today, we'll be learning to host our code on AWS's proprietary source control service "CodeCommit".
Creating a new repository
To be able to host our code, we first need to create a repository (a repository contains all of your project's files and each file's revision history).
Go to, Developer Tools > CodeCommit > Repositories > Create repository

In AWS, to be able t o access the CodeCommit, the user needs the HTTPS Git Credentials for his/her IAM user, let's assign CodeCommit access to the IAM user and generate a new HTTPS Git Credentials pair.

You can create new pair of credentials under,
IAM Users > username > Security credentials > HTTPS Git credentials for AWS CodeCommit

Make sure you download the new credentials file provided in the pop-up menu. (You won't be able to access the password again, so store it safely)

Post generating the credentials, make sure that the credentials are active otherwise your credentials won't work.

Now, before we proceed with cloning the repository, let's first create a file and commit.


You should be able to see a successful commit notification

Use either of the option to cl one your repository as shown in below image, I'll be using the HTTPS method.

On your local machine make sure you have Git installed, Create a folder and use Git to clone the repository. (use the HTTPS URL in Git Bash to clone)

You might see a pop-up window asking to enter your HTTPS Git Credentials on your first attempt, afterwards it'll store your credentials with the help of Git Credential Manager.

You should be able to see the progress in Git Bash window and a successful message once all packages are received.

Now that you have successfully clone the repository, make sure you always disable/delete unused Git Credentials to avoid issues later.

That's the simplest way to host your code on AWS CodeCommit using the Management Console. You are now ready to host your first repository and make your initial commit.😉
Hosting your cod e on AWS CodeCommit was originally published in Towards AWS on Medium, where people are continuing the conversation by highlighting and responding to this story.
Comments
Post a Comment