terraform-practices

Guide Terraform/OpenTofu testing, CI/CD, and module patterns across cloud blueprints.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Terraform/OpenTofu development often suffers from inconsistent testing, fragmented CI/CD setup, and unclear module patterns. This skill provides structured guidance to standardize testing, CI/CD, and blueprint-style module organization, reducing errors and speeding up delivery.

Core Features & Use Cases

  • Testing guidance: decision matrices for static analysis, native tests, Terratest, and testing frameworks; guidance for Terraform/OpenTofu code quality.
  • CI/CD and automation: workflow templates, remote state strategies, caching, and approvals for production environments; Atlantis integration patterns.
  • Code structure & module patterns: standard file layouts, version pinning, module separation, and migration patterns to migrate from Count to For_Each and other modern features.

Quick Start

  • Start by auditing your repository against the guidance in this skill: map current testing, CI/CD, and module patterns; identify gaps; then implement the recommended changes in small, incremental commits and validate with static analysis, plan, and tests.

Frequently Asked Questions about terraform-practices

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

FAQPage Schema
How do I structure Terraform modules and code layout for reliable infrastructure?

Standardize Terraform code structure by enforcing standard file layouts, module separation, and version pinning. This approach ensures reusable blueprint-style patterns across AWS, Azure, and GCP, directly improving configuration reliability and long-term maintainability.

What is the best way to set up CI/CD pipelines for Terraform and OpenTofu projects?

Configure Terraform CI/CD pipelines using provided workflow templates, remote state strategies, caching, and production approvals. These patterns support Atlantis integration, automating infrastructure delivery while enforcing code quality and reliable deployments.

How do I choose a testing strategy for Terraform configurations?

Select a Terraform testing strategy using decision matrices for static analysis, native tests, and Terratest. This framework evaluates code quality needs, guiding practitioners to implement robust testing practices that reduce errors before deployment.

Can I use these Terraform practices for migrating from count to for_each?

Yes, you can migrate Terraform modules from count to for_each using provided migration patterns. These standard practices guide modernizing configurations and refactoring code structures safely across supported cloud blueprints.

Does this Terraform guidance work with OpenTofu projects?

Yes, these practices explicitly support OpenTofu projects alongside Terraform. The skill provides tooling guidance, code structure standards, and testing strategies applicable to both HashiCorp Configuration Language ecosystems.

Why do my Terraform blueprint projects suffer from inconsistent testing and fragmented CI/CD?

Terraform projects suffer from fragmented CI/CD and inconsistent testing without standardized module patterns. Implementing structured guidance for blueprint-style organization, automated workflows, and decision-based testing matrices resolves these maintainability gaps.