Complete Setup

Terrateam GitHub Actions Workflow File

Store this workflow file in .github/workflows/terrateam.yml of your repository default branch.

##########################################################################
# .github/workflows/terrateam.yml
##########################################################################
# DO NOT MODIFY
#
# THIS FILE SHOULD LIVE IN .github/workflows/terrateam.yml
#
# Looking for the Terrateam configuration file? .terrateam/config.yml.
#
# See https://terrateam.io/docs/configuration for details
##########################################################################
name: 'Terrateam Workflow'
on:
  workflow_dispatch:
    inputs:
      # The work-token and api-base-url are automatically passed in by the Terrateam backend
      work-token:
        description: 'Work Token'
        required: true
      api-base-url:
        description: 'API Base URL'
jobs:
  terrateam:
    permissions: # Required to pass credentials to the Terrateam action
      id-token: write
      contents: read
    runs-on: ubuntu-latest
    timeout-minutes: 1440
    name: Terrateam Action
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Run Terrateam Action
        id: terrateam
        uses: terrateamio/action@v1 # Do not replace with a custom image. Doing so may cause Terrateam to not operate as intended.
        with:
          work-token: '${{ github.event.inputs.work-token }}'
          api-base-url: '${{ github.event.inputs.api-base-url }}'
        env:
          SECRETS_CONTEXT: ${{ toJson(secrets) }}
Start planning and applying

Cloud Provider Setup

Terrateam needs permission to access your cloud provider in order to make changes with the Terraform CLI.

Next Steps

Pull Request

Create a Pull Request with a Terraform code change
  1. Create a pull request with a Terraform code change
  2. Terrateam will automatically run terraform plan and comment back the output
  3. Comment on the pull request with terrateam apply to apply changes
  4. Merge the pull request

Common Use Cases

Click here to see configurations for common use cases

Configuration

Learn how to fully customize your workflow with our runtime configuration file.

Support

Join our Community Slack or email support if you need help on-boarding.