BDD Reference¶
Policies are Gherkin features. Each Scenario follows the same flow as terraform-compliance:
Scenario flow¶
Given → set the entity stash (jobs, includes, settings, …)
When → filter the stash (skip scenario if nothing matches)
Then → assert on every entity left in the stash (fail on violation)
And → continue the previous step type
Topics¶
- Overview of Scenario Flow:
- Stash, skip vs fail, typical patterns
- GIVEN Directives: Entity selection
- WHEN Directives: Filtering
- THEN Directives: Assertions
- Using AND: Chaining steps
- Policy Metadata:
# METADATAannotations and catalogs - Advanced scenarios: Scenario Outline matrices, value specs
- Scenario Outline deep-dive: Expansion and reporting
Related¶
Example policies live under Examples.