Over a million developers have joined DZone.

Migrating to AWS CodeCommit

DZone's Guide to

Migrating to AWS CodeCommit

Follow these step-by-step instructions for configuring AWS CodeCommit with SourceTree

· Integration Zone ·
Free Resource

SnapLogic is the leading self-service enterprise-grade integration platform. Download the 2018 GartnerMagic Quadrant for Enterprise iPaaS or play around on the platform, risk free, for 30 days.

Hosting your code in AWS CodeCommit has several advantages, the main one being seamless integration with AWS CodeDeploy and AWS CodePipeline.

I use SourceTree as my repo tool of choice, with Git/Bitbucket as the back end.

If you have a team of many developers and want to slowly migrate your code to AWS CodeCommit Git repo, you can setup your SourceTree config to push to both repo’s.

  1. You will need a SSH-2-RSA 2048 Public/Private keys, because that's what AWS supports. So once you have generated/imported the keys to AWS, you can then import the same key to your GitHub or bitbucket account. Then just add them to your pageant. Read Setting Up AWS CodeCommit.

  2. In AWS, when you import your SSH keys for an IAM User, it will give you an SSH Key ID. Write down this SSH Key ID and the password for it will be the private key password you generated with PuttyGen. Always use a password for your private key file.

    Image title

  3. AWS IAM User SSH Key

  4. In SourceTree, go to Tools/Options and set the private key to your AWS SSH Key. Remember, we added this to Bitbucket and Git, so we can now use the AWS SSH Key/Pairs for both repositories.
    Image title

  5. SourceTree Private Key

    The last part, is to configure your local repo to post to both repositories until you are happy with the migration.

  6. In SourceTree, select your repository and go to Repository/Repository Settings. Then, add a new origin. It will be in this format: ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyCoolApp

  7. When it prompts for a username and password, enter your SSH Key ID and SSH private key password.

Image title

Source Tree Remote

Once you are happy with the migration, you can then set AWS CodeCommit as the default remote by ticking the checkbox. You may need to first rename the original remote “origin” to “old” then set AWS as the default.

Download A Buyer's Guide to Application and Data Integration, your one-stop-shop for research, checklists, and explanations for an application and data integration solution.

private ,password ,git ,ssh ,id ,aws ,key

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}