# GitHub

Firefly integrates with GitHub to connect your infrastructure code repositories with your cloud resources. This integration enables powerful features like tracing cloud resources back to their defining code ("Jump to Code") and automatically creating Pull Requests for newly codified resources and drift remediation.

## Prerequisites

* A GitHub account with access to your infrastructure repositories.
* Appropriate permissions to install GitHub Apps or create Personal Access Tokens.
* Repositories containing Terraform or other IaC files you want to connect to Firefly.

## Setup Procedure

1. In Firefly, click **Settings > Integrations**.
2. Click **Add New > GitHub** (under version control integrations).
3. Install the Firefly GitHub application.
4. Select your Terraform repositories or **All repositories**.
5. Click **Install & Authorize**.
6. Enter your Password and click **Confirm password**.
7. Click **Continue with GitHub**.
8. Click **Authorize Infralight**.

## GitHub Enterprise Server (via AWS PrivateLink)

If you run **GitHub Enterprise Server** (GHES) inside a private VPC that isn't reachable over the public internet, Firefly can connect to it over AWS PrivateLink — keeping all traffic between Firefly and your GHES instance on the AWS backbone, with no public exposure.

1. Set up PrivateLink connectivity between your GHES VPC and Firefly. See the [AWS PrivateLink integration guide](/integrations/aws-privatelink.md) for prerequisites and customer-side setup (NLB + VPC Endpoint Service).
2. Coordinate with your Firefly contact to configure the GHES integration against your private endpoint.

## Features Enabled

* **Jump to Code**: Trace resources in your cloud inventory back to the GitHub file and specific line that defines them.
* **Automated Pull Requests**: When Firefly codifies an unmanaged resource, it can commit the new Terraform code as a Pull Request.
* **IaC Tracking**: Firefly maintains awareness of which resources are defined in code and which are not.
* **Drift Remediation**: Firefly can detect drift between the code and the actual resources and create a Pull Request to fix it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.firefly.ai/integrations/version-control/github.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
