terraform-test

terraform-test is a skill for Claude Code, Codex from eric861129/SKILLS_All-in-one. It costs 59 tokens per session (10,029 once invoked), scanned A, original, MIT.

A guide to Terraform's built-in testing framework, which checks infrastructure configuration through test files, scenarios, and assertions. It can validate plans, apply temporary resources, or simulate providers in supported versions.

In plain words
What is it for?
Use it to write Terraform test files, define scenarios and assertions, mock providers and data sources, and troubleshoot failed infrastructure tests.
Why use it?
It helps catch configuration changes that break expected behavior before they affect existing infrastructure or state files.

Skill for Claude CodeCodex

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

Good fit Use it to write Terraform test files, define scenarios and assertions, mock providers and data sources, and troubleshoot failed infrastructure tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eric861129/skills_all-in-one/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 eric861129/SKILLS_All-in-one --skill terraform-test
Clone the repo
git clone --depth 1 https://github.com/eric861129/SKILLS_All-in-one

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/eric861129/skills_all-in-one/terraform-test/github.svg)](https://agentmods.dev/skills/eric861129/skills_all-in-one/terraform-test)
Your own site
<a href="https://agentmods.dev/skills/eric861129/skills_all-in-one/terraform-test"><img src="https://agentmods.dev/badge/skills/eric861129/skills_all-in-one/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/eric861129/skills_all-in-one/terraform-test"><img src="https://agentmods.dev/badge/skills/eric861129/skills_all-in-one/terraform-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,029 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.
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.00059 $0.10029
Opus 5 $0.00030 $0.05014
Sonnet 5 $0.00012 $0.02006
Haiku 4.5 $0.00006 $0.01003

Measured 7d ago against content hash 20383ae8ba3e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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.

public/SKILLS/Infrastructure & Cloud/terraform-test/SKILL.md · 1,670 lines

How it starts

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

Terraform Test

Terraform's built-in testing framework enables module authors to validate that configuration updates don't introduce breaking changes. Tests execute against temporary resources, protecting existing infrastructure and state files.

Core Concepts

Test File: A .tftest.hcl or .tftest.json file containing test configuration and run blocks that validate your Terraform configuration.

Test Block: Optional configuration block that defines test-wide settings (available since Terraform 1.6.0).

Run Block: Defines a single test scenario with optional variables, provider configurations, and assertions. Each test file requires at least one run block.

Assert Block: Contains conditions that must evaluate to true for the test to pass. Failed assertions cause the test to fail.

Mock Provider: Simulates provider behavior without creating real infrastructure (available since Terraform 1.7.0).

Test Modes: Tests run in apply mode (default, creates real infrastructure) or plan mode (validates logic without creating resources).

File Structure

Terraform test files use the .tftest.hcl or .tftest.json extension and are typically organized in a tests/ directory. Use clear naming conventions to distinguish between unit tests (plan mode) and integration tests (apply mode):

my-module/
├── main.tf
├── variables.tf
├── outputs.tf
└── tests/
    ├── validation_unit_test.tftest.hcl      # Unit test (plan mode)
    ├── edge_cases_unit_test.tftest.hcl      # Unit test (plan mode)
    └── full_stack_integration_test.tftest.hcl  # Integration test (apply mode - creates real resources)

Test File Components

A test file contains:

  • Zero to one test block (configuration settings)
  • One to many run blocks (test executions)
  • Zero to one variables block (input values)
  • Zero to many provider blocks (provider configuration)
  • Zero to many mock_provider blocks (mock provider data, since v1.7.0)

Important: The order of variables and provider blocks doesn't matter. Terraform processes all values within these blocks at the beginning of the test operation.

Read the full file on GitHub · 1,670 lines

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 · 1,670 lines · 59 tokens per session scan A 20383ae8ba3e

Subscribe to this mod's changes

terraform-test is a skill published in the GitHub repository eric861129/SKILLS_All-in-one (52 stars, last pushed 4mo ago), licensed MIT. It adds 59 tokens to every session and 10,029 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

crap-index-assess

Assess method-level change risk with the Change Risk Anti-Patterns (CRAP) index and recommend focused testing or complexity reduction. Use when a repository configures CRAP measurement, cyclomatic complexity and automated test coverage data are available, or a user asks what CRAP means, how to calculate or interpret…

yarlson/yarstack · 77 tokens

test-fix

Automatically invoke when any test run produces failures. Triggers on: test output showing FAIL, test errors, or assertion failures in unit or E2E suites. Applies a strict 3-attempt limit per failure to avoid debugging spirals — stops and escalates if not resolved. Do NOT wait for user to ask; invoke immediately when…

jerseycheese/agent-skills · 91 tokens

prodtest

Senior-QA test pass on a newly implemented feature. Detects the project's real test stack, writes unit and functional/integration tests, then drives the running app with Playwright for end-to-end coverage, saving screenshots to a gitignored folder for human review. Asks upfront whether found bugs should be fixed or…

nazmulnahid-git/Ai-Stack · 90 tokens

ck:cook

Implement a feature phase by phase from a phased JSON master or Markdown plan. Before each phase, confirm whether to create/run unit tests and whether to run ck:quality, unless explicit flags supply those choices. Supports token-budgeted execution, resumable state, and TDD handoff to ck:test.

huuanh20/awesome-ai-agent-skills · 64 tokens

team-test

Tester agent. Reads ALL preceding artifacts (BA + TechLead + PM + BE + FE) and produces test plan, test cases (unit/integration/e2e), and bug report template. Declares Gate 2: UAT Readiness. Part of the Virtual Team Skill pipeline.

huuanh20/awesome-ai-agent-skills · 61 tokens

swift-testing-pro

Use when writing tests with the Swift Testing framework (@Test.

laxrajpurohit/swift-skills-pro · 16 tokens