

# Connect GitHub

An integration connects CloudWatch Omni to a tool your team already uses. When you connect GitHub, you give Omni read-only access to the repositories that you choose. Omni reads your code to show what each service does on the application map. Omni also writes repository activity, such as pushes, pull requests, deployments, and workflow runs, as change events to your account's `default` CloudWatch Dataset.

You manage the integration in **Settings**, on the **Integrations** page. A connection applies to your whole space. For information about the application map, see [Monitor applications with the application map](omni-monitor-applications-with-the-application-map.md).

GitHub is available for spaces in these AWS Regions: US East (N. Virginia), US West (Oregon), and Europe (Ireland).

The following table describes the connection types. You can add one connection of each type.


| Connection type | Use it for | What you enter | 
| --- | --- | --- | 
| GitHub.com | Repositories on github.com. No organization is needed. | None | 
| GitHub Enterprise Cloud | An organization in your enterprise on github.com. | The organization name | 
| GitHub Enterprise Cloud with data residency | An organization on your {{subdomain}}.ghe.com host. | The organization name and the host URL, for example https://{{subdomain}}.ghe.com | 
| GitHub Enterprise Server | An organization on your self-hosted server. The server must be reachable from the internet. | The organization name and the server URL, for example https://github.example.com | 

Before you connect, check the following:
+ You can create integrations in the space and write to the space's dataset (`cloudwatch:PutRecords`). Without the dataset permission, Omni can't start the connection.
+ For a GitHub Enterprise connection, you must be an owner of the organization.
+ For data residency and GitHub Enterprise Server, you must be signed in to the host and its single sign-on.
+ The console must be in the Region of your space.

## Connect GitHub.com or GitHub Enterprise Cloud
<a name="omni-connect-github-com-or-enterprise-cloud"></a>

**To connect GitHub.com or GitHub Enterprise Cloud**

1. In **Settings**, choose **Integrations**.

1. On the **GitHub** card, choose **Add connection**.

1. For **Connection type**, select **GitHub.com** or **GitHub Enterprise Cloud**.

1. For GitHub Enterprise Cloud, enter the **Organization name**.

1. Choose **Continue to GitHub**.

1. On GitHub, install the Amazon CloudWatch app.

1. Choose the repositories that Omni can read.

1. Approve the request.

Back in Omni, the connection shows **Connected**. If an organization owner must approve the app first, ask them to approve it, and then connect again.

## Connect GitHub Enterprise Cloud with data residency or GitHub Enterprise Server
<a name="omni-connect-github-enterprise-owned-app"></a>

For these types, Omni creates a GitHub App in your organization, so you go to your host twice: first to create the app, and then to install it.

**To connect data residency or GitHub Enterprise Server**

1. In **Settings**, choose **Integrations**.

1. On the **GitHub** card, choose **Add connection**.

1. For **Connection type**, select **GitHub Enterprise Cloud with data residency** or **GitHub Enterprise Server**.

1. For **Organization name**, enter the organization name. For the host URL, enter only the host, with no path, on the default HTTPS port.

1. Choose **Continue to GitHub**.

1. On your host, create the GitHub App. Don't rename it.

1. Install the app.

1. Choose the repositories that Omni can read.

1. Approve the request.

Back in Omni, the connection shows **Connected**. Setup expires after 1 hour. If it expires or fails, choose **Start over**, or choose **Remove** to delete the connection.

## What Omni can access in GitHub
<a name="omni-connect-github-what-omni-can-access"></a>

You give the app read-only access to the repositories you choose: their contents and metadata, pull requests, issues, Actions, checks, deployments, commit statuses, and administration settings, and the organization's administration settings. Omni can't change your repositories or your organization. To change which repositories Omni can read, change the app's repository access in GitHub.

## Disconnect an integration
<a name="omni-connect-github-disconnect-an-integration"></a>

On the connection in **Settings**, on the **Integrations** page, choose **Disable**. Omni stops reading the connection's repositories. Disconnecting doesn't remove the app from GitHub. To remove it completely, also uninstall the Amazon CloudWatch app in your GitHub account or organization settings. For data residency and GitHub Enterprise Server, delete the GitHub App that Omni created from the organization's settings on your host.

## Who can manage integrations
<a name="omni-connect-github-who-can-manage-integrations"></a>

Integrations apply to the whole space. One person connects, and the connection works for everyone in the space. A member's grants decide whether they can connect, change, or disconnect an integration: the integration create, update, and delete actions. Connecting GitHub also needs `cloudwatch:PutRecords` on the space's dataset. See [Custom grant actions](omni-custom-grant-actions.md).