Skill 4.7.3

Check blocks

Key Concepts

A top-level check block contains one or more assert blocks, each with a condition and error message, and can contain one scoped data source that is read only for the check. A common example uses the http data source to request a website's health endpoint and asserts that the status code is 200.

Terraform evaluates checks at the end of every plan and apply. Unlike other custom conditions, a failed assertion produces a warning and does not block the operation. In HCP Terraform, continuous validation re-runs checks on a schedule and alerts when they fail.