terraform-test

Test Terraform modules with predefined scenarios, assertions, and mock providers.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/anevjes/agenticinfraops --skill terraform-test-anevjes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-test
Source: https://github.com/anevjes/agenticinfraops/tree/main/.github/skills/terraform-test
Command: npx skills add https://github.com/anevjes/agenticinfraops --skill terraform-test-anevjes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of writing, organizing, and executing Terraform tests to ensure infrastructure code quality.

Core Features & Use Cases

  • Test Terraform modules by defining plan or apply scenarios with assertions.
  • Use mock providers for fast, isolated unit tests without accessing real Azure resources.
  • Validate configurations such as naming conventions, tags, and resource relationships.
  • Use Case: Developers testing a new module can verify resource outputs, tags, and conditions locally before deployment.

Quick Start

Use the terraform-test skill to run a test file that validates your infrastructure module's tags and resource properties.

Frequently Asked Questions about terraform-test

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

FAQPage Schema
How do I unit test Terraform modules without deploying to real cloud resources?

You can unit test Terraform modules without real cloud resources by using mock providers to run isolated tests, validating infrastructure logic and resource configurations locally before deployment.

How do I validate Terraform naming conventions and tags in a CI pipeline?

To validate Terraform naming conventions and tags in a CI pipeline, define structured test scenarios with assertions that check resource properties and outputs, enabling rapid and repeatable compliance checks.

What is the best way to structure Terraform tests for plan and apply modes?

The best way to structure Terraform tests for plan and apply modes is to define predefined scenarios with specific assertions for each mode, allowing detailed output control and robust validation of infrastructure changes.

Can I use mock providers for isolated Terraform testing?

Yes, you can use mock providers for isolated Terraform testing to achieve fast, local validation of module logic and resource relationships without accessing or modifying actual cloud environments.

Does Terraform testing support detailed output control for CI pipelines?

Yes, Terraform testing supports detailed output control designed for CI pipelines, providing structured test results and assertion outputs that facilitate robust, repeatable infrastructure validation.

Why does my Terraform test fail when checking resource relationships?

Terraform tests for resource relationships fail when predefined assertions do not match the module's outputs or configurations, indicating that the infrastructure logic violates the expected validation rules or best practices.