Welcome to this HashiCorp Terraform lab repo, where you can get hands-on experience with HashiCorp Terraform using GitHub Codespaces. In this repository, you’ll find a variety of labs that walk you through learning and using HashiCorp Terraform in different scenarios.
Note: GitHub provides users with 120 core hours for FREE per month. Check your current consumption of hours here. Additionally, you can set a limit of spending for Codespaces on your account here.
- A pre-configured development container that installs Terraform and prerequisites in your Codespace.
- Multiple labs, each with its own
README.md
and step-by-step instructions. - Example files, scripts, and configurations to help you practice Terraform's core features.
- Create a Codespace from this repo (click the button below or go to the “Code” drop-down, select “Codespaces,” and create a new one).
- Once the Codespace is running, open the integrated terminal.
- Follow the instructions in each lab to complete the exercises.
Below are different labs you can explore. Each link points to a specific lab file or folder within this repository.
Each lab is available in AWS, Azure, or GitHub - allowing you to choose the platform you're most comfortable with to learn.
Labs 1 through 5 are designed to be completed in order as each builds on the previous lab.
# | Lab | AWS | Azure | GitHub |
---|---|---|---|---|
1 | Getting Started with Terraform | AWS | Azure | GitHub |
2 | Create Your First Resource | AWS | Azure | GitHub |
3 | Working with Variables and Dependencies | AWS | Azure | GitHub |
4 | Managing Mulitple Resources | AWS | Azure | GitHub |
5 | Working with State, Data Sources, and the CLI | AWS | Azure | GitHub |
These labs are fully self-contained and can be completed in any order.
# | Lab | AWS | Azure | GitHub |
---|---|---|---|---|
6 | Making Code Dynamic and Reusable | AWS | Azure | GitHub |
7 | Simplify Code with Local Values |
AWS | Azure | GitHub |
8 | Create Mulitple Resources with count |
AWS | Azure | GitHub |
9 | Deploy Mulitple Resources with for_each |
AWS | Azure | GitHub |
10 | Managing Explicit Dependencies with depends_on |
AWS | Azure | GitHub |
11 | Using Multiple Providers for Mulitple Regions | AWS | Azure | GitHub |
12 | Managing Resource Lifecycle using lifecycle |
AWS | Azure | GitHub |
13 | Using Terraform Built-In Functions | AWS | Azure | GitHub |
These labs are fully self-contained and can be completed in any order.
# | Lab | AWS | Azure | GitHub |
---|---|---|---|---|
14 | Using Modules in the Terraform Registry | AWS | Azure | GitHub |
15 | Build Your Own Local Modules | AWS | Azure | GitHub |
These labs are fully self-contained and can be completed in any order.
# | Lab | AWS | Azure | GitHub |
---|---|---|---|---|
16 | Replacing a Single Resource | Coming Soon | Coming Soon | Coming Soon |
17 | Upgrading a Provider and Module | Coming Soon | Coming Soon | Coming Soon |
18 | Importing an Existing Resource | Coming Soon | Coming Soon | Coming Soon |
19 | Migrating State to a New Backend | Coming Soon | Coming Soon | Coming Soon |
20 | Using Terraform Workspaces | Coming Soon | Coming Soon | Coming Soon |
21 | Using Terraform Logging | Coming Soon | Coming Soon | Coming Soon |
If you’d like to add more labs or improve these, feel free to fork this repo or open a pull request. Feedback and contributions are always welcome!
Enjoy your journey with Terraform!