terraform-test

terraform-test is a skill for Claude Code, Codex from jonathan-vella/apex-accelerator. It costs 101 tokens per session (1,356 once invoked), scanned A, original, MIT.

A guide for writing and running Terraform's built-in test files, which use assertions to check infrastructure modules. It covers tests that inspect plans, simulate providers, and optionally create real resources.

In plain words
What is it for?
Use it to create .tftest.hcl files, test module inputs and validation rules, mock provider calls, and run plan- or apply-based tests.
Why use it?
It helps catch invalid infrastructure logic before deployment and separates fast checks from tests that use actual Azure resources.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create .tftest.hcl files, test module inputs and validation rules, mock provider calls, and run plan- or apply-based tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jonathan-vella/apex-accelerator/terraform-test
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jonathan-vella/apex-accelerator --skill terraform-test
Clone the repo
git clone --depth 1 https://github.com/jonathan-vella/apex-accelerator

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for terraform-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/jonathan-vella/apex-accelerator/terraform-test/github.svg)](https://agentmods.dev/skills/jonathan-vella/apex-accelerator/terraform-test)
Your own site
<a href="https://agentmods.dev/skills/jonathan-vella/apex-accelerator/terraform-test"><img src="https://agentmods.dev/badge/skills/jonathan-vella/apex-accelerator/terraform-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for terraform-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/jonathan-vella/apex-accelerator/terraform-test"><img src="https://agentmods.dev/badge/skills/jonathan-vella/apex-accelerator/terraform-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,356 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00101 $0.01356
Opus 5 $0.00051 $0.00678
Sonnet 5 $0.00020 $0.00271
Haiku 4.5 $0.00010 $0.00136

Measured 7d ago against content hash 198ffc353c06, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

terraform-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/terraform-test/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Terraform Test Skill

Write, organize, and run Terraform's built-in test framework for Azure infrastructure modules.

Reference: Terraform Testing Documentation


Quick Reference

Concept Description Min Version
Test file .tftest.hcl in tests/ directory 1.6
Run block Single test scenario with assertions 1.6
Assert block Condition that must be true for test to pass 1.6
Plan mode command = plan — validates logic, no resources created 1.6
Apply mode command = apply (default) — creates real infrastructure 1.6
Mock provider Simulates provider without real API calls 1.7
Parallel execution parallel = true on independent run blocks 1.9
Expect failures Verify validation rules reject invalid input 1.6

File Structure

my-module/
├── main.tf
├── variables.tf
├── outputs.tf
└── tests/
    ├── defaults_unit_test.tftest.hcl        # Plan mode (fast)
    ├── validation_unit_test.tftest.hcl      # Plan mode (fast)
    └── full_stack_integration_test.tftest.hcl  # Apply mode (creates resources)

Naming convention: *_unit_test.tftest.hcl (plan mode), *_integration_test.tftest.hcl (apply mode).

Test File Components

  • 0–1 test block (test-wide settings)
  • 1+ run blocks (test scenarios, sequential by default)
  • 0–1 variables block (file-level inputs, highest precedence)
  • 0+ provider blocks (provider configuration)
  • 0+ mock_provider blocks (simulated providers, TF 1.7+)

Canonical Example

See references/test-examples.md for a complete Azure Resource Group test (unit tests, tag validation, expect_failures).

Read the full file on GitHub · 132 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 132 lines · 101 tokens per session scan A 198ffc353c06

Subscribe to this mod's changes

terraform-test is a skill published in the GitHub repository jonathan-vella/apex-accelerator (50 stars, last pushed 3d ago), licensed MIT. It adds 101 tokens to every session and 1,356 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.