You can use the AWS Management Console and upload, add, or edit a file to a repository directly from the AWS CodeCommit console. This is a quick way to make a change. However, if you want to work with multiple files, files across branches, and so on, consider setting up your local computer to work with repositories. In this demo, we will learn how to setup AWS Code Commit using SSH and IAM roles.
Follow this article in Youtube
Note: This is for Linux/Mac users.
-
It is better to have a seperate groups(say
Devs
) and add your users to that group.Add Group Permission - Managed Policy -
AWSCodeCommitFullAccess
-
# Create the `.ssh` directory if it isn't there already # mkdir -p $HOME/.ssh cd $HOME/.ssh ssh-keygen # [here just create the name codecommit_rsa and leave all fields blank *just click enter*] cat codecommit_rsa.pub
-
- Now we need to enter our
codecommit_rsa.pub
into AWS IAM. - Copy the SSH key ID (for example,
APKAEIBAERJR2EXAMPLE
)
- Now we need to enter our
-
cd $HOME/.ssh touch config chmod 600 config cat > $HOME/.ssh/config << "EOF" Host git-codecommit.*.amazonaws.com User YOUR_SSH_KEY_ID_FROM_IAM IdentityFile ~/.ssh/codecommit_rsa EOF
-
ssh git-codecommit.us-east-1.amazonaws.com
You should see something like this,
You have successfully authenticated over SSH. You can use Git to interact with AWS CodeCommit. Interactive shells are not supported.Connection to git-codecommit.us-east-1.amazonaws.com closed by remote host.