Integrate Eclipse with Amazon CodeCommit - Amazon CodeCommit
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Integrate Eclipse with Amazon CodeCommit

You can use Eclipse to make code changes in a CodeCommit repository. The Toolkit for Eclipse integration is designed to work with Git credentials and an IAM user. You can clone existing repositories, create repositories, commit and push code changes to a repository, and more.

To use Toolkit for Eclipse with CodeCommit, you need the following:

Step 1: Get an access key and secret key for your IAM user

If you do not already have a credential profile set up on the computer where Eclipse is installed, you can configure one with the Amazon CLI and the aws configure command. Alternatively, you can follow the steps in this procedure to create and download your credentials. Provide them to the Toolkit for Eclipse when prompted.

Users need programmatic access if they want to interact with Amazon outside of the Amazon Web Services Management Console. The Amazon APIs and the Amazon Command Line Interface require access keys. Whenever possible, create temporary credentials that consist of an access key ID, a secret access key, and a security token that indicates when the credentials expire.

To grant users programmatic access, choose one of the following options.

Which user needs programmatic access? To By
IAM Use short-term credentials to sign programmatic requests to the Amazon CLI or Amazon APIs (directly or by using the Amazon SDKs). Following the instructions in Using temporary credentials with Amazon resources in the IAM User Guide.
IAM

(Not recommended)

Use long-term credentials to sign programmatic requests to the Amazon CLI or Amazon APIs (directly or by using the Amazon SDKs).
Following the instructions in Managing access keys for IAM users in the IAM User Guide.

Step 2: Install Amazon Toolkit for Eclipse and connect to CodeCommit

The Toolkit for Eclipse is a software package you can add to Eclipse. After you've installed it and configured it with your Amazon credential profile, you can connect to CodeCommit from the Amazon Explorer in Eclipse.

To install the Toolkit for Eclipse with the Amazon CodeCommit module and configure access to your project repository
  1. Install Toolkit for Eclipse on your local computer if you don't have a supported version already installed. If you need to update your version of Toolkit for Eclipse, follow the instructions in Set Up the Toolkit.

  2. In Eclipse, either follow the firstrun experience, or open Preferences from the Eclipse menu system (the location varies depending on your version and operating system) and choose Amazon Toolkit.

  3. Do one of the following:

    • If you are following the firstrun experience, provide your Amazon security credentials when prompted to set up your credential profile.

    • If you are configuring in Preferences and have a credential profile already configured on your computer, choose it from Default Profile.

    • If you are configuring in Preferences and you do not see the profile you want to use, or if the list is empty, choose Add profile. In Profile Details, enter a name for the profile and the credentials for the IAM user (access key and secret key), or alternatively, enter the location of the credentials file.

    • If you are configuring in Preferences and you do not have a profile configured, use the links for signing up for an account or managing your existing Amazon security credentials.

  4. In Eclipse, expand the Amazon Toolkit menu and choose Amazon CodeCommit. Choose your credential profile, and then enter the user name and password for your Git credentials or import them from the .csv file. Choose Apply, and then choose OK.

After you are signed in with a profile, the Amazon CodeCommit connection panel appears in Team Explorer with options to clone, create, or sign out. Choosing Clone clones an existing CodeCommit repository to your local computer, so you can start working on code. This is the most frequently used option.

If you don't have any repositories, or want to create a repository, choose Create.

Clone a CodeCommit repository from Eclipse

After you've configured your credentials, you can clone a repository to a local repo on your computer by checking it out in Eclipse. Then you can start working with the code.

  1. In Eclipse, open Amazon Explorer. For information about where to find it, see How to Access Amazon Explorer. Expand Amazon CodeCommit, and choose the CodeCommit repository you want to work in. You can view the commit history and other details of the repository, which can help you determine if this is the repository and branch you want to clone.

    Note

    If you do not see your repository, choose the flag icon to open the Amazon Web Services Regions menu, and choose the Amazon Web Services Region where the repository was created.

  2. Choose Check out, and follow the instructions to clone the repository to your local computer.

  3. When you have finished cloning the project, you're ready to start editing your code in Eclipse and staging, committing, and pushing your changes to your project's repository in CodeCommit.

Create a CodeCommit repository from Eclipse

You can create CodeCommit repositories from Eclipse with the Toolkit for Eclipse. As part of creating the repository, you also clone it to a local repo on your computer, so you can start working with it right away.

  1. In Amazon Explorer, right-click Amazon CodeCommit, and then choose Create repository.

    Note

    Repositories are region-specific. Before you create the repository, make sure you have selected the correct Amazon Web Services Region. You cannot choose the Amazon Web Services Region after you have started the repository creation process.

  2. In Repository Name, enter a name for this repository. Repository names must be unique within an Amazon Web Services account. There are character and length limits. For more information, see Quotas. In Repository Description, enter an optional description for this repository. This helps others understand what this repository is for, and helps distinguish it from other repositories in the region. Choose OK.

  3. In Amazon Explorer, expand Amazon CodeCommit, and then choose the CodeCommit repository you just created. You see that this repository has no commit history. Choose Check out, and follow the instructions to clone the repository to your local computer.

Working with CodeCommit repositories

After you have connected to CodeCommit, you can see a list of repositories associated with your account, by Amazon Web Services Region, in Amazon Explorer. Choose the flag menu to change the region.

Note

CodeCommit might not be available in all Amazon Web Services Regions supported by Toolkit for Eclipse.

In Toolkit for Eclipse, you can browse the contents of these repositories from the Navigation and Package Explorer views. To open a file, choose it from the list.

Git operations in Toolkit for Eclipse for CodeCommit repositories work exactly as they do for any other Git-based repository. You can make changes to code, add files, and create local commits. When you are ready to share, you use the Git Staging option to push your commits to the CodeCommit repository. If you haven't configured your author and committer information in a Git profile, you can do this before you commit and push. Because your Git credentials for your IAM user are already stored locally and associated with your connected Amazon credential profile, you won’t be prompted to supply them again when you push to CodeCommit.

For more information about working with Toolkit for Eclipse, see the Amazon Toolkit for Eclipse Getting Started Guide.