§ Learn
Learn
Two tracks in order. Track A teaches CUE from zero. Track B teaches pravo. Each lesson takes between 6 and 20 minutes.
On this page
Learn has two tracks. Track A teaches CUE with pravo as the only tool. Track B teaches pravo on top of it.
Learn teaches, in order. To do one task on a project you already understand, use How-to.
Each lesson takes between 6 and 20 minutes. It shows a problem you know from HCL, the idea that solves it, and a command you run yourself. It ends with something you can check.
Which door
I run OpenTofu or Terraform
Start with Migrate. It links to the Track A lessons that a page needs, at the point where it needs them.
I have never seen CUE
Start Track A at A1, Your data is already CUE. Then continue with Track B.
Show me the reference
Open the Reference, or the CUE cheat sheet for the language on one page.
If you write CUE already, begin Track B at B1, Providers and resources.
The two tracks
| Track | Lessons | Time | You finish with |
|---|---|---|---|
| Track A · CUE from zero | A1 to A14 and five companion pages | about 2 hours | One definition that produces three environments, checked by pravo eval. |
| Track B · pravo | B1 to B10, two labs and a project | about 2 hours, plus the labs | A specification that you plan, apply, change, move, check against a policy and destroy. |
Do Track A first. Track B assumes the CUE that Track A teaches. The quick start runs a plan before you know any CUE, and Track A explains what you saw there.
The companion pages sit beside Track A. Open them when a lesson sends you there, or when an error confuses you.
The glossary defines every term. Track A defines at most two new terms in a lesson, where they first appear.
What you need
- The
pravobinary on yourPATH. See the quick start. - A terminal, a text editor and an empty directory. A1 to A5 build on one directory. Each later lesson says where to work.
- For Track A, nothing else.
pravo evalandpravo validateevaluate plain CUE, so almost every example needs no provider, no account and no network. A10, C2, C3 and C4 each run one example with a provider from Quick start.pravo initfetches it once. - For Track B, providers that run on your machine. A lesson that needs more says so in its header, under "Needs".
Examples use a POSIX shell. The output in the lessons comes from a real run of the examples. Ids and times are normalised, and absolute paths are shortened to ./. Your terminal prints the full path.
How a lesson works
Every lesson opens with a header. It gives the time, the lesson you need first, what you will learn and when you are done. The same parts follow in the same order.
- The problem, in HCL, in a few lines.
- The idea, in one or two sentences.
- An example that you run, and its output.
- A failure that you cause. It is labelled before you run it, and the error is read line by line: path, value, rule, location.
- A prediction in some lessons. You decide, then open the answer.
- An exercise with up to two hints and a collapsed solution. Every lesson except the project A14 has a script that checks your work.
- A recap of three points and two questions to check yourself.
The sidebar lists the lessons in order, and the foot of each page links to the next one.
How progress works
Every lesson, lab and companion page of Learn ends with a Mark as done button. Your browser keeps the marks in its local storage. They stay on your machine, so another browser or device starts empty.
The sidebar marks each page you finished and shows a count of the form n of N pages done. The button toggles: press it again to clear the mark. Without JavaScript the button is absent and the pages work without it.