OPA by Example
A gentle yet fast-paced guide to OPA policy authoring to get you coding in as little as 10 minutes, accompanied by a series of guided examples to help you use OPA's language features from basic to advanced.
Essential Foundations of OPA Policy
Hands-on exercise 1 (warm-up)
Hands-on exercise 2 (authoring a rule condition)
Hands-on exercise 3 (using a package)
Hands-on exercise 4 (practicing AND & OR)
How to use the course
Rule conflict avoidance
Rule conditions overview
Ordinary conditions that succeed
Ordinary conditions that fail
Check your understanding: rule conditions
Exercises on iteration
Complete definition by enumeration
Complete definition by comprehension
Partial definition (single element per rule)
Partial definition (generating multiple elements using iteration)
Exercises on defining collections
Congrats! Here's what's next...
Help us improve!
The OPA executable
Evaluation: opa eval command
Unit testing: opa test command