Configure and Work with CodeCommit from the CLI

1 hour
  • 5 Learning Objectives

About this Hands-on Lab

In this hands-on lab, we go through the process of configuring a CodeCommit repository from the AWS Command Line Interface. We also go through some key prerequisite steps, such as installing Git, configuring HTTPS credentials, and preparing the environment to work with Git and CodeCommit. This lab covers the steps that need to be taken anytime you work with CodeCommit from the CLI.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Server from an Amazon Linux 2 AMI

Navigate to the EC2 console and create an Amazon Linux 2 server of type t3.micro with a public IP address.

Install Git and Create IAM CodeCommit Credentials

Connect to the EC2 instance and update the server. Once updated, install git. Then, navigate to Identity and Access Management (IAM) and select the cloud_user user and generate an Access Key and HTTPS Git Credentials for AWS CodeCommit.

Create CodeCommit Repository

While logged into the EC2 instance, configure AWS CLI and create a CodeCommit Repository called RepoFromCLI. Once the repo has been created, verify the repo was created in CodeCommit.

Test The Repo

From the AWS Portal, upload a file of your choice to your CodeCommit repository. Once the file has been uploaded, return to the EC2 instance and clone the repository to the EC2 instance. Verify the file you uploaded is on your EC2 instance. Once verified, practice creating a test file, add, commit, and push the file the the repo. Finally, verify the file created on the EC2 instance is available in CodeCommit through the AWS Console.

Test The Repo

From the AWS Portal, upload a file of your choice to your CodeCommit repository. Once the file has been uploaded, return to the EC2 instance and clone the repository to the EC2 instance. Verify the file you uploaded is on your EC2 instance. Once verified, practice creating a test file, add, commit, and push the file the the repo. Finally, verify the file created on the EC2 instance is available in CodeCommit through the AWS Console.

Additional Resources

Log in to the live AWS environment using the credentials provided.

Make sure you're in the N. Virginia (us-east-1) region throughout the lab.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?