
Explore infrastructure automation with OpenTofu, compare it to Terraform, and build hands-on configurations using providers, resources, and workflows from basics to production use cases.
Explore Open tofu, a production-grade open source infrastructure as code tool that compares declarative vs imperative approaches and enables platform-agnostic provisioning across clouds.
Explore OpenTofu documentation, from introduction to CLI language and internals, uncovering what OpenTofu is, its workflow, use cases, and how to use Open Tofu Configuration Language to build resources.
Learn to install OpenTofu on Linux, Mac, or Windows and connect via a platform CLI, using AWS with an Ubuntu EC2 instance, including authentication and AWS CLI setup.
Launch and configure an AWS EC2 instance with Ubuntu Server 22.04 LTS (t2 micro) in the Northern Virginia region, creating a key pair and security group to enable SSH access.
Install OpenTofu via snap on Linux, Mac OS, or Windows and verify the version; then configure AWS with the AWS CLI by creating an IAC user and access keys.
Discover how to use the OpenTofu cli to execute actions from a configuration, including init, validate, plan, apply, and destroy, with arguments like auto-approve.
Learn how open tofu providers connect to cloud platforms like AWS, how to declare multiple providers, manage provider versions, and initialize with tofu init for infrastructure automation.
Explore provider syntax and arguments in OpenTofu, reference the Terraform AWS provider and official docs, and learn credential guidance and provider schema inspection.
Write open tofu code with a terraform block, required_providers for the aws provider alias, and region set to us east one. Initialize and upgrade to 5.37.0.
Learn to configure multiple providers in OpenTofu, add a local provider, manage versions with provider blocks, and verify changes via init, lock files, and exact version constraints.
Explore library.tf, a centralized registry for open tofu and Terraform providers and modules, with an intuitive search and analytics on trending offerings and recent releases.
Explore the library.tf registry for OpenTofu and Terraform, navigating providers and modules with a search bar, insights, and copyable usage code.
Explore the open tofu workflow from init to apply, emphasizing resources, idempotent execution, validation, planning, dependency resolution, and AWS provider blocks.
Explore OpenTofu aws ec2 instance resource syntax, mandatory fields, and attributes like ami, associate, public_ip_address, and availability_zone, with references to registry and github for how to use the resource.
Learn how to automate AWS EC2 instance creation with OpenTofu in a hands-on workflow, from init and plan to apply, including AMI, instance type, and tagging.
Learn how OpenTofu handles resource updates, distinguishing in-place changes from recreations, with AWS-style examples of changing instance types and attaching security groups.
See in-place updates and recreates with open tofu using tofu apply. The demo changes an EC2 instance type and AMI ID, then uses tofu destroy to terminate resources.
Explain how resource type and name form a unique identifier in the Open Tofu Configuration Language, and how resource references enable linking an EC2 instance to a security group.
Demonstrates creating an EC2 instance and an AWS IP, then linking the IP to the instance using OpenTofu resource references. Fetch IDs with tofu show and apply changes.
Migrate from Terraform to OpenTofu with a simple, compatible process; prepare state files, install OpenTofu, run tofu init and plan, apply a small change, and rollback if needed.
Migrate a Terraform AWS EC2 deployment to OpenTofu in this demo by provisioning an EC2 instance, validating the state, and running tofu init, plan, apply, and destroy.
Learn standard OpenTofu file naming conventions, uncover input variables, and organize infrastructure code with main.tf, provider.tf, variables.tf, outputs, and .tfvars for scalable deployments.
Connect to the Open Tofu server via ssh in VS Code, organize code into sections, create a new section seven input variables folder, and add provider.tf for cleaner infrastructure configuration.
Discover how Visual Studio Code boosts infrastructure automation work with IntelliSense, built-in terminal, Git integration, extensions, and autosave, plus a Terraform demo.
Explore input variables in OpenTofu to parameterize infrastructure code, pass values into configuration files, and create flexible, reusable configs with defaults, types, descriptions, and validations.
Learn how to use input variables in OpenTofu by creating a dedicated variables.tf file, defining image id, instance type, and instance name, and validating, planning, and overriding default values.
Demonstrates using the -var option to override a default instance_type in variables.tf during plan or apply, showing how to overwrite t2.small with t2.micro from the command-line interface.
Overcome default variable values by using OpenTofu environment variables, exporting TF_VAR_instance_type to t2.nano, then running the plan to confirm the instance type change.
Learn how to move sensitive data from variables.tf to terraform.tfvars or json, set the instance type to t2.large, and run terraform plan with OpenTofu.
Explore how OpenTofu resolves variable precedence among -var, -var-file, and tfvars files, using an instance name example to show defaults overridden.
Explore how open tofu uses string, number, and boolean type arguments with list, set, map, object, and tuple constructors, and any to support flexible configurations.
Demonstrates using variable type constraints with lists and maps in OpenTofu to deploy across multiple AWS regions, then validates and plans changes with tofu validate and tofu plan.
Explore advanced use of variables in OpenTofu, including input arguments, validation rules, and nullable handling, with a demo enforcing image id to start with emi- and exceed four characters.
Learn how to declare and use output blocks in OpenTofu to extract and display deployment data, such as public IPs, with optional descriptions, sensitivity flags, and resource dependencies.
Learn to use the tofu console to query recorded metadata, extract details like an instance's public IP, and define outputs in outputs.tf to expose values in OpenTofu configurations.
Explore provisioners in OpenTofu, including local exec, remote exec, and file, and learn how the connection block enables remote access while automating post-deployment tasks like installing nginx on EC2.
Explore local exec provisioners in OpenTofu by applying a provisioner in a resource block to run a command after EC2 creation. Learn how on failure settings influence the outcome.
Examine how the remote exec provisioner in OpenTofu automates nginx installation on a newly created EC2 instance using a key pair and SSH access.
Demonstrates the file provisioner in OpenTofu by transferring a local file to a new EC2 instance. Transfers thinknext.txt with hello content to /tmp and verifies it on the server.
What’s in this course?
This Infrastructure Automation with OpenTofu course is designed for absolute beginners to experts looking to learn OpenTofu. It introduces the basic fundamental blocks needed to get started with OpenTofu. The course begins with an introduction to OpenTofu, explaining how it differs from Terraform, followed by real time OpenTofu setup, OpenTofu Configuration Language, Providers, Resources and OpenTofu Workflow. This course also covers the core critical concepts such as Input variables, Output block, Provisioners and Datasources, Modules, Backends, State File management followed by other topics like workspaces, Graphs, Taints, Dependencies and much more. We will also learn how existing Terraform code can be migrated to the OpenTofu ecosystem with ease. Don’t worry if you are new to OpenTofu, we are going to get started with the absolute basics. Each lecture in this course is accompanied by real hands-on demos.
What is OpenTofu?
In today's complex IT landscape, creating, managing and updating a variety of infrastructure platforms and their services (can be IaaS, PaaS or SaaS) can be a daunting task. This is where OpenTofu - a powerful open-source, community driven, stable, simple and impartial software steps in, offering powerful Infrastructure as Code capabilities. The OpenTofu project is part of The Linux Foundation and the first release of OpenTofu was made in January 2024.
Legal Notice:
OpenTofu is open-source, community-driven Infrastructure as Code tool which is managed by the Linux Foundation. OpenTofu and the OpenTofu logo are trademarks or registered trademarks of The Linux Foundation in one or many countries. The Linux Foundation and other parties may also have trademark rights in other terms used herein. This course is not certified, accredited, affiliated with, nor endorsed by The Linux Foundation.
Student Testimonials:
★★★★★ "Speaker has clear, slow and precise English language (great from my perspective, use the speed button if to slow for you). The content is presented in a way to slowly ease you into it. Gets my recommendation for the OpenTofu/Terraform uninitiated."
★★★★★ "Thoroughly enjoyed the course. It was a great learning experience and my concepts are crystal clear now. Thank you, you've been a life saver."
Course Structure:
Lectures
Demos
Quizzes
Assignments
Course Contents:
Introduction to OpenTofu
Getting Started with OpenTofu
OpenTofu Configuration Language
OpenTofu Providers
OpenTofu Workflow and Resources
Migrating from Terraform to OpenTofu
Input Variables
Output Values
Provisioners
Data Sources
Modules and Registries
State files
OpenTofu Remote State and Backends
Working with OpenTofu - timeouts, taints, graphs, aliases
Local Value Block
Import Existing Infrastructure
Meta-Arguments - Lifecycle Rules, depends_on, count, for_each
Built-In Functions
Workspaces
Course Update History
March 22, 2024 - Added New Lecture and Demo for Project3 - Container Orchestration Service (Amazon EKS)
June 03, 2024 - Added a new section "Registries with GUI [Update June 2024]" which includes introduction to Library<dot>tf followed by Hands-on Demo
All sections in this course are demonstrated Live. The intention for enrolled users is to setup their own OpenTofu environment, perform the exercises and learn by doing!!!