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.