Hosting your code on AWS CodeCommit

Hosting your code on AWS CodeCommit | Harsh Patel

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

Creating a new repository on CodeCommit

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.

Assigning AWS CodeCommit Power user permission

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

Creating a new pair of credentials

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)

Downloading the new credentials< /figcaption>

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

Credentials in active status

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

Creating a sample file
Enter the details and commit changes

You should be able to see a successful commit notification

Commit successful notification

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

Using the HTTPS URL to clone the repository

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)

Git Bash to clone the repository

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.

Entering the HTTPS Git Credentials

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

Git Bash progress window

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

Revoking the HTTPS Git Credentials

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.

Namaste Devops is a one stop solution view, read and learn Devops Articles selected from worlds Top Devops content publishers inclusing AWS, Azure and others. All the credit/appreciations/issues apart from the Clean UI and faster loading time goes to original author.

Comments

Did you find the article or blog useful? Please share this among your dev friends or network.

An android app or website on your mind?

We build blazing fast Rest APIs and web-apps and love to discuss and develop on great product ideas over a Google meet call. Let's connect for a free consultation or project development.

Contact Us

Trending DevOps Articles

Working with System.Random and threads safely in .NET Core and .NET Framework

Popular DevOps Categories

Docker aws cdk application load balancer AWS CDK Application security AWS CDK application Application Load Balancers with DevOps Guru Auto scale group Automation Autoscale EC2 Autoscale VPC Autoscaling AWS Azure DevOps Big Data BigQuery CAMS DevOps Containers Data Observability Frequently Asked Devops Questions in Interviews GCP Large Table Export GCP Serverless Dataproc DB Export GTmetrix Page Speed 100% Google Page Speed 100% Healthy CI/CD Pipelines How to use AWS Developer Tools IDL web services Infrastructure as code Istio App Deploy Istio Gateways Istio Installation Istio Official Docs Istio Service Istio Traffic Management Java Database Export with GCP Jenkin K8 Kubernetes Large DB Export GCP Linux MSSQL March announcement MySQL Networking Popular DevOps Tools PostgreSQL Puppet Python Database Export with GCP Python GCP Large Table Export Python GCP Serverless Dataproc DB Export Python Postgres DB Export to BigQuery Sprint Top 100 Devops Questions TypeScript Client Generator anti-patterns of DevOps application performance monitoring (APM) aws amplify deploy blazor webassembly aws cdk application load balancer security group aws cdk construct example aws cdk l2 constructs aws cdk web application firewall aws codeguru reviewer cli command aws devops guru performance management aws service catalog best practices aws service catalog ci/cd aws service catalog examples azure Devops use cases azure devops whitepaper codeguru aws cli deploy asp.net core blazor webassembly devops guru for rds devops guru rds performance devops project explanation devops project ideas devops real time examples devops real time scenarios devops whitepaper aws docker-compose.yml health aware ci/cd pipeline example host and deploy asp.net core blazor webassembly on AWS scalable and secure CI/CD pipelines security vulnerabilities ci cd pipeline security vulnerabilities ci cd pipeline aws smithy code generation smithy server generator
Show more