Can I use Spacelift's GitHub App credentials for the GitHub Terraform provider?
Last updated: December 19, 2025
Context
When using the GitHub Terraform provider to manage GitHub resources, users often want to avoid using long-lived credentials like personal access tokens. Some users may want to leverage the GitHub App authentication that Spacelift uses for its GitHub integration to authenticate the Terraform provider instead.
Answer
While Spacelift's built-in GitHub App credentials are not directly accessible, you can set up your own GitHub App for use with the GitHub Terraform provider. Here are two approaches:
Option 1: Direct Spacelift Integration
Create a custom GitHub App with the necessary permissions for your Terraform operations
Store the GitHub App credentials as a variable in Spacelift
Configure the GitHub provider in your Terraform configuration using these credentials
Option 2: Security-Enhanced Approach
Create a custom GitHub App with the required permissions
Store the GitHub App credentials in a secret that belongs to the integration role used by the worker
Configure your Terraform provider to access these credentials through the worker role
Note that the actual permissions and capabilities available will depend on how the GitHub App is configured.
Sources: