docs-terraform-guidelines

IaC Guidelines

Guidelines to work with Terraform and Terragrunt

🎯 Our purpose

This documentation is provided by the Theodo Cloud IaC Guild. Its purpose is to present guidelines and best practices about terraform/terragrunt development.

You do not have to see these guidelines as an absolute truth, but more as a proposition to answer frequently asked questions and avoid issues you will often face in your projects.

πŸ€– AI Agent Plugin

Install the iac-guidelines plugin from this repository’s theodo-iac marketplace to use these guidelines with Claude Code, GitHub Copilot CLI and Codex CLI. It provides five skills (guidelines, read-only audit, C4 and architecture diagrams, version upgrade) and two agents (iac-developer, read-only iac-auditor; Codex has skills only).

claude plugin marketplace add padok-team/docs-terraform-guidelines
claude plugin install iac-guidelines@theodo-iac

For IDEs that do not load plugins (e.g. Codex IDE), copy the skills/ folders and the guideline folders they reference into your project.

See the installation and compatibility guide for marketplace commands, local installation, invocation examples and maintenance instructions.

πŸ€– GitHub Copilot Integration

To leverage these guidelines in your own IaC projects, we provide comprehensive GitHub Copilot instructions that help generate standards-compliant Terraform and Terragrunt code.

Copy the GitHub Copilot instructions to your project’s .github/copilot-instructions.md to enable Copilot to:

These instructions encapsulate all the best practices from this documentation into actionable guidance for GitHub Copilot, making it easier to maintain consistency across your infrastructure codebase.

πŸ” IaC Audit Prompt

For existing codebases, use the iac-audit skill of the plugin to evaluate compliance with these standards:

/iac-audit

This prompt provides comprehensive analysis including:

Why IaC ?

Infrastructure as Code (IaC) is a key practice in modern software development that allows teams to manage and provision infrastructure through code, rather than manual processes. This approach brings several benefits:

🌟 Standards 🌟

The 3 gold standards for your infrastructure codebase

The standards for layers

The standards for modules

The standard naming convention

We recommend everyone to follow the WYSIWYG pattern for vanilla terraform and the Context pattern for Terragrunt.

πŸš€ Guidelines

You’ll find below details of the standards to follow when working with Terraform and Terragrunt.

πŸ›— Patterns

Reusable solution to a commonly occurring problem within a given context

πŸ”„ Lifecycle operations

πŸŽ“ Standards

Standards help to avoid waste and ensure that we deliver value

Terraform

Terragrunt

🚩 Red flags

Red flag is something that you must pay attention about. This is an advice or recommendation, not a requirement.

πŸ› οΈ Tooling

License

License