A super easy way to grant access to a AWS CodeCommit repository from an EC2 instance hosting e.g. Jenkins is to grant proper IAM Role permissions
{ "Effect": "Allow", "Action": "codecommit:*", "Resource": "*" }
and configure git client to use a helper:
git config --global credential.helper '!aws codecommit credential-helper $@' git config --global credential.useHttpPath true
Voila!