Welcome to the Terramate Workshop! This workshop is designed to guide you through the essentials of using Terramate to manage Terraform at scale.
You will learn how to add Terramate to an existing Terraform project, refactor Terraform configurations, generate Terraform code with Terramate, and orchestrate a multi-region Terraform monorepo. By the end of this workshop, you will have a fully functioning setup with pull requests and GitHub Actions workflows.
To learn more about Terramate head over to their website https://terramate.io
In this workshop, you will:
-
Add Terramate to an Existing Terraform Project: Learn how to integrate Terramate into your current Terraform setup.
-
Refactor Terraform and Introduce Code Generation: Organize and refactor your Terraform codebase for better maintainability and scalability, and use Terramate to generate Terraform configurations dynamically.
-
Orchestrate a Multi-Account Monorepo with Code Generation and Reusable Modules: Set up a large-scale Terraform monorepo that spans multiple AWS accounts, leveraging Terramate's powerful orchestration capabilities and reusable modules.
-
Implement CI/CD with GitHub Actions: Integrate your Terraform workflows with GitHub Actions to automate testing, validation, and deployment through pull requests.
Note
Each step of the workshop includes detailed instructions (docs/) and examples to help you understand and apply the concepts effectively. Whether you are new to Terramate or looking to enhance your Terraform management skills, this workshop will provide you with the knowledge and tools you need to succeed.
Note
For now this workshop does not cover the Terramate Cloud offering!
To ensure that each participant has the correct structure to complete each step, the required files and directories for each part of the workshop are contained in their own branch within the git repository.
-
Use this template
This repository is a template and you need to create a new repository in your own Gitub account based on it, creating-a-repository-from-a-template.
Important
Make sure that you select Include all branches to include the directory structure and files from all branches in the template.
-
Setup your Development environment:
You have a couple of options when it comes to setting up a working development environment required to run this workshop.
- Install terraform, terramate on directly on your host machine (if you havent already) 🙈
- Setup using Devbox using the included
devbox.jsonfile. Getting started with Devbox 🖖🏼 - Run in a DevContainer using the included
.devcontainer/devcontainer.jsonandDockerfilein VSCode or using a tool like Devpod (advanced usage - requiring a container runtime installed and more configuration) 🐳
-
Ensure that you have access to an AWS Account
To switch to the appropriate branch for each part of the workshop, use the following commands:
Warning
Since you will basically created a new git repository and included all branches, branches are considered unrelated and lack shared history between them. As such you need to git merge main --allow-unrelated-histories to merge main into workshop/part-3 and workshop/part-4 branches.
-
Add Terramate to an Existing Terraform Project:
git checkout workshop/part-1
-
Refactor Terraform and Introduce Code Generation:
git checkout workshop/part-2
-
Orchestrate a Multi-Account Monorepo with Code Generation and Reusable Modules:
git checkout workshop/part-3
-
Implement CI/CD with GitHub Actions:
git checkout workshop/part-4
Important
Parts 3 and 4 relates to each other, requires you to merge you changes and create actual pull-requests.
Each branch contains the necessary files and directory structure for that part of the workshop. Follow the instructions provided in each part to complete the workshop successfully.
Let's get started! 🚀