Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

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

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

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.

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

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

Published at DZone with permission of Romiko Derbynew, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}