Quickstart Guide
The following steps on this page will help you to set up Terrateam, integrate it with GitHub, and run your first Terraform deployment in just a few steps.
Prerequisites
Before getting started with Terrateam quickstart guide, make sure you have the following:
- A GitHub account to fork the Terrateam demo repository.
- GitHub Actions enabled in your forked repository.
- Administrator access to install the Terrateam GitHub app.
Demo Repository Workflow
To have an overview on how to use Terrateam, use the the Terrateam ready-to-use demo repository with pre-configured Terraform code. Follow these steps to quickly test Terrateam’s capabilities.
-
Fork the Demo Repository
Click the link above to access our demo repository, then click the Fork button in the top-right corner of the page.
On the “Create a new fork” screen, keep the default settings and click “Create fork”.
-
Install the Terrateam GitHub Application (if you haven’t already)
Sign up for a Terrateam account and install the GitHub app. Then, select the organizations and repositories that contain your Terraform code.
After installation, go to your Terrateam dashboard. Your forked repository should appear there. -
Clone Your Forked Repository
Clone the repository to your local machine and navigate to its directory:
Terminal window git clone https://github.com/<your-username>/kick-the-tires.gitcd kick-the-tires -
Create a New Branch
Create a branch to make your changes:
Terminal window git checkout -b test-branch -
Modify a Terraform File
Let’s modify a file to test the workflow, changes are detected automatically. Open
staging/compute/main.tf
and change the instance name.module "staging_compute_instance" {source = "../../modules/compute"instance_count = 0instance_name = "staging-instance-modified"instance_zone = "us-central1-a"boot_disk_image = "debian-cloud/debian-11"network_name = "default"} -
Commit and Push Your Changes
Commit your changes and push them to your branch:
Terminal window git add .git commit -m "Testing Terrateam workflow"git push origin test-branch -
Create a Pull Request
Go to your forked repository on GitHub. You should see a prompt to create a pull request for your recently pushed branch.
Important: Make sure to change the base repository to your fork instead of creating a PR on the original Terrateam repository. The base should be your
main
branch, and the compare should be yourtest-branch
. -
Watch the Automatic Terraform Plan
Once the pull request is created, Terrateam will automatically trigger a
terraform plan
. This plan will appear as a comment on your pull request, showing what changes would be made.This plan is a preview of what will happen when you apply the changes.
-
Apply the Changes
To execute the changes, comment
terrateam apply
on the pull request.After you add the comment, the Terrateam app will run the
terraform apply
command. This will apply the previous plan to the Terraform file, updating your infrastructure. -
Merge Your Changes
Once applied and everything looks good, you can merge the pull request to incorporate the changes into your main branch.