TE

terraform-test

Enables creation and execution of Terraform tests using `.tftest.hcl` files to validate infrastructure behavior without deploying resources.

Install

mkdir -p .claude/skills/terraform-test && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5157" && unzip -o skill.zip -d .claude/skills/terraform-test && rm skill.zip

Installs to .claude/skills/terraform-test

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.
340 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Generates.tftest.hcl test files
  • Configures run blocks for validation
  • Mocks provider behavior for testing
  • Filters tests between plan and apply modes

How it works

Constructs test scenarios in.tftest.hcl files that execute either plan-mode checks (no resources) or apply-mode checks (real resources).

Inputs & outputs

You give it
Terraform module path and test scenarios
You get back
Generated test files and assertion logic

When to use terraform-test

  • Writing infrastructure unit tests
  • Mocking providers for testing
  • Validating module outputs
  • Setting up CI/CD test pipelines

About terraform-test

Provides instructions on using run blocks, assert blocks, and mock providers to test Terraform modules. It ensures configuration changes do not break infrastructure.

Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.

When not to use it

  • When working with Terraform versions below 1.7.0 for mocks
  • For temporary configurations that will not be maintained

Prerequisites

Terraform 1.7.0+Terraform project structure

Limitations

  • Apply-mode tests create real infrastructure, incurring costs
  • Requires explicit knowledge of Terraform test syntax

How it compares

Utilizes the native testing framework for infrastructure safety rather than external testing scripts.

Compared to similar skills

terraform-test side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
terraform-test (this skill)14moReviewIntermediate
senior-devops77moReviewAdvanced
devops-iac-engineer27moReviewAdvanced
run-acceptance-tests26moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

senior-devops

davila7

Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.

720

devops-iac-engineer

davila7

Implements infrastructure as code using Terraform, Kubernetes, and cloud platforms. Designs scalable architectures, CI/CD pipelines, and observability solutions. Provides security-first DevOps practices and site reliability engineering guidance.

223

run-acceptance-tests

hashicorp

Guide for running acceptance tests for a Terraform provider. Use this when asked to run an acceptance test or to run a test with the prefix `TestAcc`.

22

devops-engineer

Jeffallan

Use when setting up CI/CD pipelines, containerizing applications, or managing infrastructure as code. Invoke for pipelines, Docker, Kubernetes, cloud platforms, GitOps.

12

terraform-specialist

sickn33

Expert Terraform/OpenTofu specialist mastering advanced IaC automation, state management, and enterprise infrastructure patterns. Handles complex module design, multi-cloud deployments, GitOps workflows, policy as code, and CI/CD integration. Covers migration strategies, security best practices, and modern IaC ecosystems. Use PROACTIVELY for advanced IaC, state management, or infrastructure automation.

12

onboarding

ColeMurray

Deploy your own Open-Inspect instance. Use when the user wants to set up, deploy, or onboard to Open-Inspect. Guides through repository setup, credential collection, Terraform deployment, and verification with user handoffs.

10

Search skills

Search the agent skills registry