# Day 50: Your CI/CD pipeline on AWS - Part-1 🚀 ☁ (Jan 15, 2024)

### **What is CodeCommit ?**

* CodeCommit is a managed source control service by AWS that allows users to store, manage, and version their source code and artifacts securely and at scale just like GitHub. It supports Git, integrates with other AWS services, enables collaboration through branch and merge workflows, and provides audit logs and compliance reports to meet regulatory requirements and track changes. Overall, CodeCommit provides developers with a reliable and efficient way to manage their codebase and set up a CI/CD pipeline for their software development projects.
    

### **Task-01 :**

* Set up a code repository on CodeCommit and clone it on your local.
    

1. Login to aws account by using valid credentials. Search “**CodeCommit**” from search box and click on it. Click on “**Create repository**”.
    

![](https://miro.medium.com/v2/resize:fit:875/1*tUZSmqyPyN16BChs1omJjw.png align="left")

2\. Enter mandatory details like “**Repository name**”. Click on “**Create**”.

![](https://miro.medium.com/v2/resize:fit:875/1*A9upaLDnBeBzY_qQ5ojNvw.png align="left")

3\. Repository will be created and visible.

![](https://miro.medium.com/v2/resize:fit:875/1*bSBn_J2ZbblhM_-fEshDoA.png align="left")

![](https://miro.medium.com/v2/resize:fit:875/1*tX0dvUIAmGMa8sek7ZLV1Q.png align="left")

* You need to setup GitCredentials in your AWS IAM.
    

1. Open visual studio code and open a new terminal. Give command “**git status**”. Error will come.
    

![](https://miro.medium.com/v2/resize:fit:875/1*A8j8t7nY5z-Jb4IYszUHXw.png align="left")

2\. Go to search box in aws console. Search for “**IAM**”. Click on “**Users**”.

![](https://miro.medium.com/v2/resize:fit:875/1*mfU9xQqgu_dRwsaJFuMyNg.png align="left")

3\. Your user will be visible. Click on the user.

![](https://miro.medium.com/v2/resize:fit:875/1*Ixa_kAntkjfaIhRh27L1gg.png align="left")

4\. After clicking on user, navigate to “**Security credentials**”.

![](https://miro.medium.com/v2/resize:fit:875/1*Ie67ha39d8xvk9VDBVgimw.png align="left")

5\. Under security credentials, scroll down and come to “**HTTPS Git credentials for AWS CodeCommit**”. Click on “**Generate credentials**”.

![](https://miro.medium.com/v2/resize:fit:875/1*gDrdtXw7pKhB4bQCSIUwXg.png align="left")

6\. Download your credentials in your system for further usage.

![](https://miro.medium.com/v2/resize:fit:875/1*Xs2t9ZTMM-1LuulKBesmow.png align="left")

* Use those credentials in your local and then clone the repository from CodeCommit.
    

1\. Click on third icon from left in VS Code. On top 3 dots will appear. Click on three dots. “**Remote**” option will come. Under that “**Add Remote**” will be visible and click on it.

![](https://miro.medium.com/v2/resize:fit:875/1*9Pt1YE-UwICfYVW40OQUxA.png align="left")

2\. Enter cloned repository URL.

![](https://miro.medium.com/v2/resize:fit:875/1*I0JSE2gxcEFOPBsZYmqAlg.png align="left")

3\. Enter username from the file which you downloaded earlier.

![](https://miro.medium.com/v2/resize:fit:875/1*A6H3sASVJ1NsH0i-TulLnw.png align="left")

4\. Enter password from the file which you downloaded earlier. Click on “**Enter**” button from your keyboard.

![](https://miro.medium.com/v2/resize:fit:875/1*uC82N7s6SRoOhs1Z9MrWlQ.png align="left")

5\. Click on “**Add permissions**” dropdown and click on “**Add permissions**”.

![](https://miro.medium.com/v2/resize:fit:875/1*c2WEok25vJSTjeBzBfd3kA.png align="left")

6\. Click on “**Next**”.

![](https://miro.medium.com/v2/resize:fit:875/1*L3vZENiDE2QZCWtm-dY1Qw.png align="left")

7\. Click on “**Add permissions**”.

![](https://miro.medium.com/v2/resize:fit:875/1*xRZYgIRwwKC9eCn115V9ZA.png align="left")

8\. Your policy will be created and added to your user.

![](https://miro.medium.com/v2/resize:fit:875/1*A52MAuzohm1ZobwrusYYEw.png align="left")

### **Task-02 :**

* Add a new file from local and commit to your local branch.
    

1. Go to your VS Code. Clone your repository from CodeCommit using command “**git clone &lt;repository\_url&gt;**”. Make a new file “**index.html**” and write desired code in it as given below in the screenshot.
    

![](https://miro.medium.com/v2/resize:fit:875/1*zMRQDQYYIftrn4R-FclL5w.png align="left")

2\. Fire the command “**git status**”, “**git add .**”, “**git comit -m “&lt;any\_message&gt;”**”.

![](https://miro.medium.com/v2/resize:fit:875/1*FPIx6iwiYquirBWx2AdJyQ.png align="left")

* Push the local changes to CodeCommit repository.
    

1. Fire the command “**git push origin master**” to push newly made file in local to CodeCommit repository.
    

![](https://miro.medium.com/v2/resize:fit:875/1*rmd72DKy_L0noIsDMlyKDw.png align="left")

2\. Open CodeCommit. Go to your repository and click on it.

![](https://miro.medium.com/v2/resize:fit:875/1*tX6Nz9KhwQptMadefV8VKg.png align="left")

3\. You will be able to see “**index.html**” file in your repositoory.

![](https://miro.medium.com/v2/resize:fit:875/1*lQbP_y_CjOz84fT3wUZ5bQ.png align="left")

Thanks for reading the blog. Hope it helps!
