Welcome to the OpenTofu Foundations Workshop! This repository contains the materials and resources for a 10-week, hands-on workshop series designed to help you build and enhance your skills in Infrastructure as Code (IaC) using OpenTofu.
The OpenTofu Foundations Workshop is a free, 10-week series where we guide participants through the process of becoming confident OpenTofu practitioners. Each week focuses on a key aspect of OpenTofu, covering everything from the basics of IaC to advanced infrastructure management and scaling.
The goal is to provide a practical, hands-on learning experience, allowing you to apply the skills you acquire directly to real-world infrastructure projects.
This series is designed to build your knowledge incrementally. Each session focuses on a specific topic, and by the end of the series, you’ll have a comprehensive understanding of how to manage, scale, and automate infrastructure with OpenTofu.
Introduction to OpenTofu, its purpose, and basic installation. Learn to set up a project and understand the foundational concepts of Infrastructure as Code. Write your first OpenTofu configuration and define basic infrastructure resources like compute instances and networking components.
Organize your code with reusable modules. Learn how to import modules into configurations and apply best practices for modular infrastructure design.
Learn to enhance your infrastructure configurations using OpenTofu’s built-in and custom functions, and control structures. This session will cover how to use functions and control structures like conditionals and loops to create dynamic and adaptable configurations. We'll also dive into creating custom functions using opentofu/terraform-provider-go
to extend the functionality of your setups.
Explore advanced resource configurations using locals, outputs, blocks, dynamic blocks, and dependencies. Create more dynamic and flexible infrastructure setups.
Integrate OpenTofu into CI/CD pipelines to automate infrastructure deployments. Set up a pipeline to test, validate, and apply configurations reliably.
Learn how to incorporate testing and validation into your OpenTofu workflows. This session will focus on tools and practices for testing your infrastructure code, including syntax validation, resource policy checks, and simulating infrastructure changes before applying them. By the end of this week, you'll know how to ensure that your configurations are reliable, secure, and ready for production.
Manage and deploy infrastructure across multiple environments. Set up configurations for development, staging, and production to ensure consistency.
Explore how OpenTofu manages the state of your infrastructure. Learn about state files, secure storage, and state locking strategies for managing multiple environments.
Deep dive into state management, reading remote state, including importing existing infrastructure and handling state changes. Learn best practices for managing legacy resources.
Focus on scaling OpenTofu for large infrastructures and adopt best practices. Organize large projects, manage team collaboration, and implement advanced infrastructure strategies.
- An AWS Account - Register here, everything we'll build is on the AWS Free Tier
- OpenTofu CLI - Download here
- Download the AWS CLI (here) and setup your AWS credentials - Docs here
- (Optional) A Massdriver Account - Get a free one-year trial here
Find an AWS Linux Machine Image (AMI) for your region:
aws ec2 describe-images \
--filters \
"Name=owner-alias,Values=amazon" \
"Name=platform-details,Values=Linux/UNIX" \
"Name=name,Values=amzn2-ami-hvm-2.*-x86_64-gp2" \
--query 'Images[*].[Name,ImageId]' \
--output text \
--region YOUR_REGION_HERE
- Beginners: If you're new to Infrastructure as Code, this series will help you build a strong foundation in OpenTofu.
- Intermediate Users: If you're familiar with other IaC tools, this workshop will help you apply those skills using OpenTofu’s capabilities.
- Advanced Users: This series will deepen your knowledge of advanced topics like state management, resource imports, and scaling infrastructure.
Each week, resources such as example configurations, supporting documentation, and notes will be uploaded here. You can follow along with the workshop by:
- Cloning the repo.
- Following the instructions provided for each week’s session.
- Experimenting with the example configurations and trying out the exercises.