

# GitHub connector for Amazon AppFlow
GitHub

GitHub is a service that hosts code repositories for software developers, and it provides version control with Git. If you're a GitHub user, your account contains data about your repositories, such as branches, commits, and pull requests. You can use Amazon AppFlow to transfer data from GitHub to certain AWS services or other supported applications.

## Amazon AppFlow support for GitHub


Amazon AppFlow supports GitHub as follows.

**Supported as a data source?**  
Yes. You can use Amazon AppFlow to transfer data from GitHub.

**Supported as a data destination?**  
No. You can't use Amazon AppFlow to transfer data to GitHub.

## Before you begin


To use Amazon AppFlow to transfer data from GitHub to supported destinations, you must meet these requirements:
+ You have an account with GitHub that contains the data that you want to transfer. For more information about the GitHub data objects that Amazon AppFlow supports, see [Supported objects](#github-objects).
+ In the developer settings of your account, you've created either of the following resources for Amazon AppFlow. These resources provide credentials that Amazon AppFlow uses to access your data securely when it makes authenticated calls to your account.
  + An OAuth app. For the steps to create one, see [Creating an OAuth App](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app) in the GitHub Docs.
  + A personal access token. For the steps to create one, see [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) in the GitHub Docs.
+ If you created an OAuth app, you've configured it with the following settings:
  + You've set the homepage URL to `https://console.aws.amazon.com/appflow/home`.
  + You've specified a callback URL for Amazon AppFlow.

    Redirect URLs have the following format:

    ```
    https://region.console.aws.amazon.com/appflow/oauth
    ```

    In this URL, *region* is the code for the AWS Region where you use Amazon AppFlow to transfer data from GitHub. For example, the code for the US East (N. Virginia) Region is `us-east-1`. For that Region, the URL is the following:

    ```
    https://us-east-1.console.aws.amazon.com/appflow/oauth
    ```

    For the AWS Regions that Amazon AppFlow supports, and their codes, see [Amazon AppFlow endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/appflow.html) in the *AWS General Reference.*
  + You've generated a client secret.
+ If you created a personal access token, it permits the following recommended scopes. If you want to allow fewer scopes, you can omit any that apply to objects that you don't want to transfer.
  + `repo:status`
  + `repo_deployment`
  + `public_repo`
  + `security_events`
  + `admin:repo_hook`
  + `read:repo_hook`
  + `read:org`
  + `read:public_key`
  + `notifications`
  + `read:user`
  + `user:email`
  + `read:discussion`

  For more information about these scopes, see [Available scopes](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes) in the GitHub Docs.

If you created an OAuth app, note the client ID and client secret. If you created a personal access token, note the token value. You provide these values to Amazon AppFlow when you connect to your GitHub account.

## Connecting Amazon AppFlow to your GitHub account
Connecting to GitHub

To connect Amazon AppFlow to your GitHub account, provide the client credentials from your OAuth app, or provide a personal access token. If you haven't yet configured your GitHub account for Amazon AppFlow integration, see [Before you begin](#github-prereqs).

**To connect to GitHub**

1. Sign in to the AWS Management Console and open the Amazon AppFlow console at [https://console.aws.amazon.com/appflow/](https://console.aws.amazon.com/appflow/).

1. In the navigation pane on the left, choose **Connections**.

1. On the **Manage connections** page, for **Connectors**, choose **GitHub**.

1. Choose **Create connection**.

1. In the **Connect to GitHub** window, for **Select authentication type**, choose how to authenticate Amazon AppFlow with your GitHub account when it requests to access your data:
   + Choose **OAuth2** to authenticate Amazon AppFlow with the client ID and client secret from an OAuth app. Then, enter values for **Client ID** and **Client secret**.
   + Choose **BasicAuthPersonalAccessToken** to authenticate Amazon AppFlow with a personal access token. Then, enter values for **User name** and **Personal Access Token**.

1. Optionally, under **Data encryption**, choose **Customize encryption settings (advanced)** if you want to encrypt your data with a customer managed key in the AWS Key Management Service (AWS KMS).

   By default, Amazon AppFlow encrypts your data with a KMS key that AWS creates, uses, and manages for you. Choose this option if you want to encrypt your data with your own KMS key instead.

   Amazon AppFlow always encrypts your data during transit and at rest. For more information, see [Data protection in Amazon AppFlow](data-protection.md).

   If you want to use a KMS key from the current AWS account, select this key under **Choose an AWS KMS key**. If you want to use a KMS key from a different AWS account, enter the Amazon Resource Name (ARN) for that key.

1. For **Connection name**, enter a name for your connection.

1. Choose **Continue**. A window appears that asks if you want to allow Amazon AppFlow to access your GitHub account.

1. Choose **Authorize**.

1. Confirm the access request with GitHub. You can choose **Send SMS** to use a two-factor authentication code, or you can choose **Use your password** to enter your password.

On the **Manage connections** page, your new connection appears in the **Connections** table. When you create a flow that uses GitHub as the data source, you can select this connection.

## Transferring data from GitHub with a flow
Transferring data from GitHub

To transfer data from GitHub, create an Amazon AppFlow flow, and choose GitHub as the data source. For the steps to create a flow, see [Creating flows in Amazon AppFlow](create-flow.md).

When you configure the flow, choose the data object that you want to transfer. For the objects that Amazon AppFlow supports for GitHub, see [Supported objects](#github-objects).

Also, choose the destination where you want to transfer the data object that you selected. For more information about how to configure your destination, see [Supported destinations](#github-destinations).

## Supported destinations


When you create a flow that uses GitHub as the data source, you can set the destination to any of the following connectors: 
+ [Amazon Lookout for Metrics](lookout.md)
+ [Amazon Redshift](redshift.md)
+ [Amazon RDS for PostgreSQL](connectors-amazon-rds-postgres-sql.md)
+ [Amazon S3](s3.md)
+ [HubSpot](connectors-hubspot.md)
+ [Marketo](marketo.md)
+ [Salesforce](salesforce.md)
+ [SAP OData](sapodata.md)
+ [Snowflake](snowflake.md)
+ [Upsolver](upsolver.md)
+ [Zendesk](zendesk.md)
+ [Zoho CRM](connectors-zoho-crm.md)

## Supported objects


When you create a flow that uses GitHub as the data source, you can transfer any of the following data objects to supported destinations:

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/appflow/latest/userguide/connectors-github.html)