> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gitar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS CodeCommit

> Connect AWS CodeCommit repositories and configure event delivery to Gitar.

<Badge color="blue">Preview</Badge>

<Note>
  AWS CodeCommit is available on the **Enterprise plan**. Contact your enterprise account manager to enable CodeCommit preview access for your organization.
</Note>

Connect one AWS account and region per installation. See [Platform Support](/connecting-code/platform-support) for feature availability.

## Prerequisites

* A Gitar organization with CodeCommit preview access enabled.
* Administrator access to the organization's configuration in Gitar.
* An AWS CLI installation with an AWS SSO profile for the account that owns the repositories.
* Permission to create and configure IAM roles and inline policies in that account.

## Connect repositories

<Steps>
  <Step title="Add an installation">
    In the Gitar dashboard, open **Settings → Configuration** and find **Amazon CodeCommit**. Open the connection and select **+ Add installation**.

    Enter the 12-digit **AWS account ID** and **AWS region**, such as `us-east-1`. Repeat setup for each additional account or region.
  </Step>

  <Step title="Choose AWS access">
    Select **Get Setup Instructions** and choose the capabilities to grant. Select it again to generate the setup script for that account and region.

    | Capability | Access granted |
    | - | - |
    | Code review on pull requests | Read repositories and PRs, and post review comments. |
    | Interactive pull requests | Reply to comments and manage Gitar's comments. |
    | Fixes for pull requests | Push fix commits to connected repositories. |
    | Summaries for pull requests | Write review summaries into PR descriptions. |
    | CI analysis | Read CodeBuild results, CodePipeline actions, and CloudWatch build logs. |
  </Step>

  <Step title="Run the AWS setup script">
    Review and download the **Complete setup script** from Gitar. Run it with the AWS SSO profile for the repository account:

    ```bash theme={null}
    bash gitar-codecommit-setup.sh <aws-profile>
    ```

    The script signs in to AWS and checks the account ID before configuring IAM roles. It creates the Gitar bot and provisioner roles, plus the role EventBridge uses to deliver events. Review the generated policies before running the script.
  </Step>

  <Step title="Finish setup and validate access">
    Return to Gitar and select **I'm Done**. Gitar adds the installation and configures EventBridge delivery for PR and comment events. CI analysis also needs delivery of CodeBuild and CodePipeline events.

    Select **Validate AWS access** on the installation. Repository permission checks are skipped until at least one repository is connected. Add repositories in the next step, then validate again to complete those checks.

    To repair missing permissions, generate setup instructions again and rerun the script.
  </Step>

  <Step title="Select repositories">
    Open the installation's repository manager, select **Add repositories**, choose the repositories to connect, and select **Add selected**.

    Return to the installation and select **Validate AWS access** again. Resolve any failed capability or delivery checks before testing a PR.

    Open a PR or push a commit to an open PR in a connected repository. Gitar posts review findings when the review completes.
  </Step>
</Steps>

## Comments and fixes

Reply `Gitar fix` to a finding to request a fix. The PR author can request fixes. Other commenters need push permission that Gitar can validate through AWS IAM.

CodeCommit drops PR comment threads from the **Changes** tab after a fresh commit. But the **Activity** tab still preserves context and interaction with Gitar. Refresh the page to see Gitar's replies and fix commits.

## CI failure analysis

**CI analysis** is selected by default during setup. The generated setup script supplies access to build results and logs, and Gitar configures event delivery during onboarding.

CodeBuild is supported, including CodeBuild actions invoked by CodePipeline. Other CodePipeline action providers are not supported. See [CI Failure Analysis](/features/ci-failure-analysis) for the analysis workflow.

## Disconnect an installation

Select **Delete installation** to disconnect all repositories for that AWS account and region. Gitar revokes webhook credentials and removes Gitar-managed EventBridge resources. Customer IAM roles remain in AWS and can be removed separately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.