AWS CodeCommit

Using Jira Server or Data CenterSee the corresponding article.

Integrate AWS CodeCommit with Jira Cloud

AWS CodeCommit is a git host service by Amazon Web Services to store and manage source code, related files and private Git repositories in the cloud.

You can use the AWS CLI or the AWS CodeCommit console to track and manage your repositories.

Quickly learn how to connect AWS CodeCommit git repositories via Git Integration for Jira Cloud.

What's on this page:


Required Permissions

important

Before performing an AWS CodeCommit integration, make sure to configure the recommended permissions.

The permissions detailed in the connect/Auto-connect wizard are necessary for specific features to work.

We recommend that the following AWS IAM policies are configured beforehand based on what features that will be used.

Configure AWSCodeCommitReadOnly » IAM policy for basic features:

Feature

Required Permission

Feature

Required Permission

show commits, process smart commits, show branches

codecommit:ListRepositories
codecommit:GitPull

show pull requests

codecommit:ListPullRequests
codecommit:GetPullRequest

Configure AWSCodeCommitPowerUser » IAM policy for all features:

Feature

Required Permission

Feature

Required Permission

create pull request

codecommit:CreatePullRequest

create branch

codecommit:CreateBranch

delete branch

codecommit:DeleteBranch

configure webhooks automatically

codecommit:GetRepositoryTriggers
codecommit:PutRepositoryTriggers
sns:CreateTopic
sns:DeleteTopic
sns:Subscribe

See this article for related information.

Webhooks/Triggers

recommended

CodeCommit doesn't have webhooks but it has SNS triggers requiring a subscription confirmation ».

For webhooks to work automatically, the IAM user used to setup the connection must have the configure webhooks automatically permissions (see Required permissions above – under IAM policy for all features).  If permissions has not been set, the repositories are connected but no webhooks are created.

While the new UI is not fully functional in AWS CodeCommits, users are required to create triggers via the old UI or with the API.

Shorthand:
With an existing AWS CC repository, enable triggers then create an SNS topic and subscribe to that topic.

For more information on Amazon SNS, see Amazon SNS: Getting Started ».



Right click here to open this video in a new browser tab for more viewing options.

 

Using Auto-Connect

This process requires an AWS account with existing CodeCommit repositories.

We recommend using the Auto-connect integration panel to connect multiple repositories from your AWS CodeCommit git host.

To connect your repository to Jira thru the Git Integration for Jira app, open the Connect to Git Repository wizard:

  1. On the Jira Cloud dashboard menu, go to AppsGit Integration: Manage Git repositories. The git configuration page for connecting repositories is displayed.

  2. On the Auto-connect integration panel, click AWS CodeCommit.  The Auto-connect wizard is displayed.

    1. Select the Region where the CodeCommit repositories reside then enter credentials for the Access key ID and Secret access key.

    2. See below on the supported regions:

      • AWS GovCloud (US)

      • AWS GovCloud (US-East)

      • US East (N. Virginia)

      • US East (Ohio)

      • US West (N. California)

      • US West (Oregon)

      • Canada (Central)

      • EU (Ireland)

      • EU (Frankfurt)

      • EU (London)

      • EU (Paris)

      • EU (Stockholm)

      • EU (Milan)

      • Asia Pacific (Mumbai)

      • Asia Pacific (Singapore)

      • Asia Pacific (Sydney)

      • Asia Pacific (Seoul)

      • Asia Pacific (Tokyo)

      • Asia Pacific (Hong Kong)

      • Middle East (Bahrain)

      • South America (Sao Paulo)

      • China (Beijing)

      • China (Ningxia)

      • Africa (Capetown)

  3. Click Connect to continue. On the following screen, Git Integration for Jira app will read all available repositories from your AWS CodeCommit account. Click Import repositories.
    Repositories of the logged-in AWS CodeCommit user can be automatically connected to Jira Cloud. Repositories that are added or removed from AWS CodeCommit will be likewise connected or disconnected from Jira Cloud.

  4. After the import process, the Settings dialog is displayed.

    • On the Integration Settings, setting the Require User PAT option to ON, will require users to provide valid AWS Access Key ID and Secret Access Key for branch and pull requests creation/deletion (via the developer panel » on the Jira issue page). The required permission must be configured for the service user to do specific tasks as described in the Required Permissions section.

    • Set Project Permissions according to your organization's project association rules.

  5. Click Finish.

The AWS CodeCommit repositories are now connected to Jira Cloud.

The Git Integration for Jira app supports tracked folders for AWS CodeCommit git repositories. The connected git host is scanned for existing repository folders.  The found repositories can then be added to the Git Repositories configuration.

There are two ways to configure the git repository connection using tracked folders with Git for Jira Cloud:

  • connect via Auto-connect integration panel > AWS CodeCommit, or

  • connect via Connect to Git Repository dropdown > AWS CodeCommit.

If the connected git host has newly added repositories, the Git Integration for Jira app will automatically add them to the git repositories configuration on the next reindex.  For the deleted git repositories, these will be removed from the Git repositories configuration on the next reindex.

Single Repository (Manually Connect via HTTP/HTTPS)

Connect a single AWS CodeCommit repository manually to Jira via HTTP/HTTPS connection.

Use the host HTTP/HTTPS git clone URL from your AWS CodeCommit repository home portal.  Click on the HTTPS (Clone URL column - column 1) and paste it on the Connect to Git Repository screen.

  1. On your Jira Cloud dashboard menu, go to AppsGit Integration: Manage Git repositories,

  2. On the following screen, click Connect to Git Repository. The next screen is displayed.

  3. Click Next to proceed.

  4. On the Permissions screen, set Project Association permissions, if required. Otherwise, leave it as is. Click Connect to continue to the next step.

    • On the Authentication screen, enter  Access key ID and Secret access key.

  5. Click Connect to complete this setup.

The repository is now connected to Jira Cloud.

Single Repository (Manually Connect via SSH)

Right click here to open this video in a new browser tab for more viewing options.

Connect a single AWS CodeCommit repository manually to Jira via SSH connection.

SSH connections are handled automatically if the PUBLIC KEY was added in the AWS IAM console and the associated PRIVATE KEY was added/uploaded on the Jira side (Manage Git repositories page ➜ SSH Keys ➜ Add SSH Key).

If authentication issues are encountered during connecting an AWS repository to Jira, modify the original URL by inserting the SSH Key ID as the username.  The SSH Key ID is an alphanumeric sequence provided by AWS IAM when importing a PUBLIC KEY for a particular user account in IAM.

For example, the original URL is:

1 ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/test-repo

If the SSH Key ID 1a2b3c4d5e is applied to the original SSH URL, the resulting URL would be:

The modified URL can now be used as a valid repository URL via Manage Git repositories page ➜ Connect to Git Repository.

The Git Integration for Jira app automatically configures web linking for AWS CodeCommit repositories in Jira Cloud.

Viewing Git Commits in Jira Cloud

  1. Perform a git commit by adding the Jira issue key in the commit message. This will associate the commit to the mentioned Jira issue.

  2. Open the Jira issue.

  3. Scroll down to the Activity panel then click the Git Commits tab.

  4. Click View Full Commit to view the code diff.

Working with Branches and Pull Requests

This section requires the necessary permissions for all features.

The Git Integration for Jira app supports creation of branches and pull requests from Jira via the developer panel.

Default Branch

Most git integrations allow changing of the default branch of the repository/project other than "master".  This change is reflected in the  Repository Settings of the Git Integration for Jira app on the next reindex.  Auto-connected integrations support this feature where Git Integration for Jira app gets the default branch from almost all integrations and apply this setting at repository level. 

Main branch for repositories within an integration can only be changed on the git server.

Creating Branches

On your Jira Cloud, open a Jira issue.  On the Jira developer panel under Git Integration, click Create branch. The following dialog is displayed.

Pointers:

  1. Select a Repository from the list.

    1. The selected repository will display the git service logo to identify which git host it is located from.

    2. If there are several repositories with the same name, the listed CodeCommit repositories will have their names attached with a region name. For example, us-west-2/test-repo.

    3. Use the search box to look for the specific repository that will be used.

    4. Optional – designate the repository to be the default selected repository for current Jira project.  To configure default repositories for more than one Jira project - use the User settings page.

  2. Choose the newly-created branch as the Source branch.

  3. Set master as the Target branch.

  4. Enter a descriptive Title or leave it as is (recommended).

  5. Click Create Branch.

The branch is created and can be viewed under the Branches tab in your AWS CodeCommit web portal.

Creating Pull Requests

The pull request feature works the same as merge request.

On your Jira Cloud, open the Jira issue where your previously created a branch. On the developer panel under Git Source Code, click Create Pull Request. The following dialog is displayed.

Pointers:

  1. Select your working Repository.

    1. The selected repository will display the git service logo to identify which git host it is located from.

    2. If there are several repositories with the same name, the listed CodeCommit repositories will have their names attached with a region name. For example, us-west-2/test-repo.

    3. Use the search box to look for the specific repository that will be used.

    4. Optional – designate the repository to be the default selected repository for current Jira project.  To configure default repositories for more than one Jira project - use the User settings page.

  2. Set the Source branch to the newly-created branch.

  3. Set the Target branch to master.

  4. Give the pull request Title a descriptive name or leave it as is.

  5. Click Create pull request to create the pull request.

Pull/merge requests are still indexed based on branch name even if the PR/MR title does not have the Jira issue key – as long as the branch name contains the Jira issue key.

The pull request is listed on the developer panel of the Jira issue page.

The pull request is also ready for approval by the reviewers in your AWS CodeCommit web portal.

The branch and the pull request status are displayed on the developer panel.

More Integration Guides