GitHub integrations are used only by the Deploy module for template synchronization. They do not participate in security scanning.
Prerequisites
Before you begin, make sure you have:- A GitHub account with access to the repository containing your Terraform templates
- The repository follows the Amnify template structure
- The following values ready:
- Repository — in
owner/repoformat (e.g.,my-org/infra-templates) - Access Token — a GitHub personal access token with read access to the repository
- Repository — in
Choosing a Token Type
GitHub offers two types of personal access tokens:
We recommend fine-grained tokens because they let you restrict access to the specific repository that contains your templates — nothing else in your GitHub account is exposed.
Method 1: Fine-Grained Token (Recommended)
Step 1: Create the Token
- Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Direct link: github.com/settings/tokens?type=beta
- Click Generate new token
- Fill in:
- Token name — e.g.,
Amnify Template Sync - Expiration — choose an appropriate expiration (e.g., 90 days, or custom)
- Resource owner — select the organization or account that owns the repository
- Token name — e.g.,
- Under Repository access, select Only select repositories and pick the repository that contains your templates
- Under Permissions → Repository permissions, grant:
- Contents → Read-only
- Metadata → Read-only (automatically selected)
- Click Generate token
- Copy the token immediately — it starts with
github_pat_and won’t be shown again
Step 2: Add the Integration in Amnify
- Navigate to Integrations and click Create integration
- Select GitHub as the provider
- Fill in:
- Display Name (optional) — a friendly label (e.g., “Infra Templates Repo”)
- Repository — in
owner/repoformat (e.g.,my-org/infra-templates) - Branch (optional) — the branch to sync from; defaults to
mainif not provided - Access Token — paste the
github_pat_...token
- Click Create
Method 2: Classic Token
Use this if fine-grained tokens are not available in your organization or you prefer a simpler setup.Step 1: Create the Token
- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Direct link: github.com/settings/tokens
- Click Generate new token (classic)
- Fill in:
- Note — e.g.,
Amnify Template Sync - Expiration — choose an appropriate expiration
- Note — e.g.,
- Under Select scopes, check:
repo(Full control of private repositories) — required for reading private repository contents
- Click Generate token
- Copy the token immediately — it starts with
ghp_and won’t be shown again
Step 2: Add the Integration in Amnify
Follow the same steps as Method 1, Step 2 above.What Happens Next
Once connected, you can:- Navigate to Deploy → Templates and click Sync Templates to import templates from your repository
- Browse and use synced templates when creating Deployments
- Add or modify templates by pushing changes to your repository and syncing again
Rotating Tokens
When your token expires, Amnify will no longer be able to sync templates. To rotate:- Generate a new token in GitHub following the steps above
- Delete the existing GitHub integration in Amnify
- Create a new integration with the new token