Connect to the instance:

chmod 400 KEYPAIR.pem
ssh -i KEYPAIR.pem [email protected]

Install Git:

sudo yum install -y git

Setup Git Credential Helper:

git config --global credential.helper '!aws codecommit credential-helper [email protected]'
git config --global credential.UseHttpPath true

Now you can clone the CodeCommit repo which will look something like the following:

https://git-codecommit.us-east-1.amazonaws.com/v1/repos/My-Repo