Menu
AWS CodeCommit
User Guide (API Version 2015-04-13)

Integrate Eclipse with AWS CodeCommit

You can use Eclipse to make code changes in an AWS 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 AWS 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 AWS CLI and the aws configure command. Alternatively, you can follow this procedure to create and download your credentials. Provide them to the Toolkit for Eclipse when prompted.

To get the access key ID and secret access key for an IAM user

Access keys consist of an access key ID and secret access key, which are used to sign programmatic requests that you make to AWS. If you don't have access keys, you can create them from the AWS Management Console. We recommend that you use IAM access keys instead of AWS account root user access keys. IAM lets you securely control access to AWS services and resources in your AWS account.

The only time that you can view or download the secret access keys is when you create the keys. You cannot recover them later. However, you can create new access keys at any time. You must also have permissions to perform the required IAM actions. For more information, see Delegating Permissions to Administer IAM Users, Groups, and Credentials in the IAM User Guide.

  1. Open the IAM console.

  2. In the navigation pane of the console, choose Users.

  3. Choose your IAM user name (not the check box).

  4. Choose the Security credentials tab and then choose Create access key.

  5. To see the new access key, choose Show. Your credentials will look something like this:

    • Access key ID: AKIAIOSFODNN7EXAMPLE

    • Secret access key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

  6. To download the key pair, choose Download .csv file. Store the keys in a secure location.

    Keep the keys confidential in order to protect your account, and never email them. Do not share them outside your organization, even if an inquiry appears to come from AWS or Amazon.com. No one who legitimately represents Amazon will ever ask you for your secret key.

Related topics

Step 2: Install AWS Toolkit for Eclipse and Connect to AWS CodeCommit

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

To install the Toolkit for Eclipse with the AWS 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 precise location will vary depending on your version and operating system) and choose AWS Toolkit.

  3. Do one of the following:

    • If you are following the firstrun experience, provide your AWS 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 the list in 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, provide a name for the proifle and the credentials for the IAM user (access key and secret key), or alternatively provide 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 a new account or managing your existing AWS security credentials.

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

    
                        Configuring Git credentials in Eclipse with the Toolkit for Eclipse installed.

After you are signed in with a profile, the AWS CodeCommit connection panel appears in Team Explorer with options to clone, create, or sign out. Choosing Clone clones an existing AWS 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 an AWS 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 AWS Explorer. For more information about where to find it, see How to Access AWS Explorer. Expand AWS CodeCommit, and choose the AWS 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 AWS regions menu, and choose the region where the repository was created.

    
                   Choosing your AWS CodeCommit repository in the AWS Explorer.
  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 AWS CodeCommit.

Create an AWS CodeCommit Repository from Eclipse

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

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

    Note

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

  2. In Repository Name, type a name for this repository. Repository names must be unique within an AWS account. There are character and length limits. For more information, see Limits. Optionally, in Repository Description, type a 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 AWS Explorer, expand AWS CodeCommit, and then choose the AWS CodeCommit repository you just created. You will 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 AWS CodeCommit Repositories

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

Note

AWS CodeCommit might not be available in all 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 AWS 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 AWS 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 AWS credential profile, you won’t be prompted to supply them again when you push to AWS CodeCommit.

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