Compliance as code keeps audits repeatable, reviewable and continuous. The InSpec Generator writes a single InSpec control that targets a resource under test and asserts a condition, so you can verify Terraform-managed infrastructure the same way on every run instead of relying on manual checks. InSpec is an open-source framework from Chef in which you describe the desired state of infrastructure in Ruby and a runner verifies it against live resources.
Pick the resource under test, supply its constructor arguments, choose a check (exist, tagged, encrypted or property) and set an impact score from 0.1 to 1.0. The output is valid Ruby ready to drop into a profile and run with inspec exec against AWS, Azure or GCP. Because the control is generated from a form, you avoid typos in control syntax and keep a consistent structure across many controls. InSpec controls are self-documenting: the title and description fields appear in HTML and JSON reports, so auditors see intent and result together.
Input is validated and errors are reported inline, for example when the control id contains spaces or the resource name is not lowercase. Everything runs locally with nothing uploaded, so credentials and resource names never leave the browser. Generated controls plug straight into an InSpec profile folder, which you can version in Git and execute in CI so compliance is checked on every change rather than once a quarter.
Pair this generator with the Terraform plan output to confirm that new resources meet your tagging, encryption and existence rules before they are applied. The Markdown export also makes it easy to attach the control to a pull request or a wiki page for review, keeping the policy close to the infrastructure code it guards.