tf-policy

Official

Policy-as-code for Terraform with guardrails.

Authorhashi-demo-lab
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Terraform policy as code provides a single source of truth for validating and constraining Terraform configurations. tf-policy defines the standard blocks, evaluation semantics, and tooling references to ensure infrastructure changes meet governance and compliance requirements before they are deployed.

Core Features & Use Cases

  • Policy blocks: Supports resource_policy, provider_policy, and module_policy to express guards across resources, providers, and modules.
  • Testing & evaluation: Uses .policytest.hcl mocks with meta, attrs, and prior_attrs to validate policy behavior across lifecycle stages.
  • Enforcement levels & lifecycle: Enables advisory or mandatory policies with operation-scoped applicability and evaluation stages for setup/plan/apply.
  • Documentation reference: Centralizes policy definitions and semantics to map compliance baselines to tfpolicy syntax.

Quick Start

Create a sample tf-policy resource_policy and validate it with tfpolicy test against a mock plan.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: tf-policy
Download link: https://github.com/hashi-demo-lab/terraform-agentic-workflows-demo09/archive/main.zip#tf-policy

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.