Day 50: Your CI/CD pipeline on AWS - Part-1 πŸš€ ☁

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”.

2. Enter mandatory details like β€œRepository name”. Click on β€œCreate”.

3. Repository will be created and visible.

  • 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.

2. Go to search box in aws console. Search for β€œIAM”. Click on β€œUsers”.

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

4. After clicking on user, navigate to β€œSecurity credentials”.

5. Under security credentials, scroll down and come to β€œHTTPS Git credentials for AWS CodeCommit”. Click on β€œGenerate credentials”.

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

  • 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.

2. Enter cloned repository URL.

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

4. Enter password from the file which you downloaded earlier. Click on β€œEnter” button from your keyboard.

5. Click on β€œAdd permissions” dropdown and click on β€œAdd permissions”.

6. Click on β€œNext”.

7. Click on β€œAdd permissions”.

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

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 <repository_url>”. Make a new file β€œindex.html” and write desired code in it as given below in the screenshot.

2. Fire the command β€œgit status”, β€œgit add .”, β€œgit comit -m β€œ<any_message>””.

  • 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.

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

3. You will be able to see β€œindex.html” file in your repositoory.

Thanks for reading the blog. Hope it helps!

Β