Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

OpenTofu Workshop

OpenTofu is the open source fork of Terraform. Both read the same .tf files.

Install

The workshop runs in a Linux shell. On Windows that is WSL, so open your WSL terminal and work there for everything below.

devbox pins the OpenTofu version for everybody:

devbox shell

Check with tofu --version.

If you have no WSL at all, install OpenTofu natively instead, in PowerShell with winget install --exact --id=OpenTofu.Tofu. The exercises then work the same, only the paths use backslashes.

Vocabulary

  • provider talks to one system, here your filesystem or Conduktor.
  • resource is one thing you want to exist, described in a .tf file.
  • data source is something that already exists and is only read.
  • state is the record of what OpenTofu created, in terraform.tfstate.
  • plan compares your files against that record and prints the difference.
  • apply carries the plan out.

Exercises

Folder Topic
01_file A resource, and the state behind it
02_data Reading something you do not own
03_variables Inputs, outputs, one resource per entry
04_module The same, wrapped in a module
05_conduktor Kafka topics in Conduktor Console

Each folder has a README. Change into it and run:

tofu init      # once per folder
tofu plan      # what would change
tofu apply     # do it
tofu destroy   # undo it

05_conduktor needs the Console from conduktor-local/ running.

Generated Files

terraform.tfstate is what OpenTofu remembers, keep it. .terraform/ holds the downloaded providers, tofu init recreates it. .terraform.lock.hcl pins provider versions, commit it.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages