terraform-test

Execute Terraform test run blocks with assertions in plan and apply modes.

47|5|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/Cloudgeni-ai/opengeni --skill terraform-test-cloudgeni-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-test
Source: https://github.com/Cloudgeni-ai/opengeni/tree/main/packages/runtime/src/bundled_hashicorp_terraform_skills/terraform-test
Command: npx skills add https://github.com/Cloudgeni-ai/opengeni --skill terraform-test-cloudgeni-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Terraform Test prevents infrastructure changes from breaking existing behavior by running configuration assertions in isolated test runs before you deploy.

Core Features & Use Cases

  • Plan-mode unit tests: Fast checks that validate expressions, validations, and computed outputs without needing real cloud credentials.
  • Apply-mode integration tests: Creates temporary infrastructure to verify real behavior of modules and resource relationships.
  • Mock providers for deterministic tests: Simulate providers and data sources (Terraform 1.7.0+) so CI can validate logic reliably and quickly.

Quick Start

Use the terraform-test skill to run Terraform tests in plan mode for your module assertions and optionally add apply-mode integration runs where you need real resource verification.

Frequently Asked Questions about terraform-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run unit tests for Terraform configurations without cloud credentials?

Terraform testing supports plan-mode unit tests that validate expressions, validations, and computed outputs without needing real cloud credentials, using .tftest.hcl run blocks with assertions to verify configuration logic safely.

What is the best way to validate Terraform module changes in CI pipelines?

Mock providers (Terraform 1.7.0+) and plan-mode tests offer deterministic, CI-friendly validation for Terraform modules, allowing you to filter test runs and simulate data sources to reliably verify configuration logic before deployment.

Does Terraform testing work with apply-mode for integration verification?

Yes, Terraform testing supports apply-mode integration tests that create temporary infrastructure to verify the real behavior of modules and resource relationships, ensuring changes do not break existing behavior.

When do I need mock providers for Terraform test scenarios?

You need mock providers when running deterministic tests in CI that validate Terraform logic reliably and quickly, simulating providers and data sources to avoid external dependencies and flaky test results.

What file formats are required for Terraform test configurations?

Terraform testing requires .tftest.hcl or .tftest.json files containing run blocks with assert and expect_failures statements, along with optional test variables and providers for plan and apply modes.