Skip to content

Static Credentials

Quick Start

Static credentials are the fastest way to get Terrateam working with GCP. You’ll create a GCP service account with programmatic access and store the credentials as GitHub secrets.

Setup Steps

  1. Create a Service Account

    Create a dedicated service account for Terrateam in your GCP project:

    Terminal window
    gcloud iam service-accounts create terrateam \
    --description="Terrateam service account" \
    --display-name="Terrateam" \
    --project="$PROJECT_ID"
  2. Attach IAM Role

    Attach an IAM role to give Terrateam the necessary permissions. We suggest roles/editor as a starting point:

    Terminal window
    gcloud projects add-iam-policy-binding "$PROJECT_ID" \
    --member="serviceAccount:terrateam@$PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/editor"
  3. Create Service Account Key

    Generate a service account key file:

    Terminal window
    gcloud iam service-accounts keys create terrateam-service-account-key.json \
    --iam-account="terrateam@$PROJECT_ID.iam.gserviceaccount.com"
  4. Set GitHub Secret

    Add the GCP service account key as a secret to your GitHub repository:

    Terminal window
    # Set your repository (replace with your actual org/repo)
    export REPO="your-org/your-repo"
    # Create the Google Credentials secret from the key file
    gh secret --repo "$REPO" set GOOGLE_CREDENTIALS < terrateam-service-account-key.json

Security Considerations

Next Steps

Now that you have GCP authentication configured, you are now able to use Terrateam for plan and apply operations against GCP resources.