terraform-test

Write and execute Terraform tests with .tftest.hcl files and run blocks.

3|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/MehdiRtal/dotfiles --skill terraform-test-mehdirtal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-test
Source: https://github.com/MehdiRtal/dotfiles/tree/main/dot_agents/skills/terraform-test
Command: npx skills add https://github.com/MehdiRtal/dotfiles --skill terraform-test-mehdirtal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and tools for writing and executing tests for Terraform configurations, ensuring infrastructure code quality and preventing regressions.

Core Features & Use Cases

  • Write and Run Terraform Tests: Learn to create .tftest.hcl files with run blocks for apply or plan modes.
  • Validate Infrastructure: Use assert blocks to check resource attributes, outputs, and conditions.
  • Mock Providers & Data Sources: Simulate provider behavior for faster, isolated unit tests.
  • Use Case: You've updated a Terraform module and want to ensure it still deploys correctly and meets all defined outputs without manual intervention. Use this Skill to write and run tests that validate the changes.

Quick Start

Use the terraform-test skill to validate your Terraform configuration by running 'terraform test'.

Frequently Asked Questions about terraform-test

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

FAQPage Schema
How do I write tests for Terraform configurations using the built-in testing framework?

Mock providers in Terraform tests simulate provider behavior, enabling faster and isolated unit tests. This allows you to validate module logic without deploying actual cloud infrastructure resources.

What is the best way to validate Terraform module updates and prevent regressions?

Terraform test files support variables and plan options, allowing you to execute both unit and integration tests. You can configure these elements within your `.tftest.hcl` files to validate module behavior across different scenarios.

Can I mock providers and data sources for isolated Terraform unit tests?

Terraform test files support variables and plan options, allowing you to execute both unit and integration tests. You can configure these elements within your `.tftest.hcl` files to validate module behavior across different scenarios.

How do I use assert blocks to check resource attributes in Terraform test files?

Terraform test files support variables and plan options, allowing you to execute both unit and integration tests. You can configure these elements within your `.tftest.hcl` files to validate module behavior across different scenarios.

Does the Terraform testing framework support state management for integration testing?

Terraform testing covers execution commands, run blocks, and assertions to validate infrastructure changes. This ensures robust infrastructure code quality and prevents regressions during module deployments.