terraform-practices

Automate testing and code organization for Terraform/OpenTofu projects.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/poc-micro-frontends/terraform-infrastructure --skill terraform-practices-poc-micro-frontends
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-practices
Source: https://github.com/poc-micro-frontends/terraform-infrastructure/tree/main/skills/terraform-practices
Command: npx skills add https://github.com/poc-micro-frontends/terraform-infrastructure --skill terraform-practices-poc-micro-frontends

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Terraform/OpenTofu projects often struggle with inconsistent testing, fragmented CI/CD pipelines, and uneven code patterns across teams. This skill provides a structured approach to testing, CI/CD integration, and reusable module patterns to improve reliability and maintainability.

Core Features & Use Cases

  • Native tests (Terraform/OpenTofu 1.6+) and Terratest guidance for unit and integration checks.
  • CI/CD patterns, including validation, plan, apply, and automated checks, with guidance on reusable workflows and environment separation.
  • Code-structure and module-pattern best practices, documentation conventions, and version management across blueprints.
  • Real-world scenarios: aligning blueprint-based projects to common standards and enabling AI-assisted code generation and adaptation.

Quick Start

Audit a Terraform/OpenTofu project and begin applying the skill's testing, CI/CD, and module-pattern guidance.

Frequently Asked Questions about terraform-practices

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

FAQPage Schema
How do I set up testing for Terraform and OpenTofu projects?

Terraform and OpenTofu testing is structured around native tests for version 1.6+ and Terratest for integration checks. This approach covers static analysis, plan testing, and policy checks to ensure infrastructure code reliability before deployment.

What's the best way to structure CI/CD pipelines for Terraform modules?

Terraform CI/CD pipelines should include validation, plan, apply, and automated checks with reusable workflows. Environment separation and version management across blueprints ensure consistent module patterns and reliable infrastructure delivery.

Does this Terraform testing approach work with OpenTofu projects?

Yes, Terraform testing approaches fully support OpenTofu projects. The structured testing and code organization patterns apply to both tools, covering native tests, Terratest guidance, and modern features like try(), moved blocks, optional(), and nullable attributes.

How do I handle secrets securely in Terraform CI/CD workflows?

Secure secret handling in Terraform CI/CD requires structured approaches that integrate with environment separation and automated validation checks. This ensures sensitive data is protected during plan and apply operations while maintaining consistent module patterns.

When should I use native Terraform tests versus Terratest?

Native Terraform tests suit unit and static analysis checks using version 1.6+ features, while Terratest handles integration testing. Combining both provides comprehensive coverage across plan testing, policy checks, and cross-variable validation for blueprint-style projects.

How do I standardize Terraform module patterns across multiple teams?

Standardizing Terraform module patterns requires documentation conventions, versioning, and environment strategies applied across blueprints. This skill evangelizes code patterns including modularization and cross-variable validation to align teams on consistent infrastructure practices.