terraform-iac

Audit Terraform configurations and modules for HCL codebase improvements.

7|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/camilooscargbaptista/cto-toolkit --skill terraform-iac-camilooscargbaptista
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-iac
Source: https://github.com/camilooscargbaptista/cto-toolkit/tree/main/terraform-iac
Command: npx skills add https://github.com/camilooscargbaptista/cto-toolkit --skill terraform-iac-camilooscargbaptista

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Many teams struggle with unmaintainable, insecure, or poorly structured Terraform code, leaking secrets into state, inconsistent module interfaces, and brittle CI/CD workflows that cause drift or accidental destructive changes. This Skill provides actionable guidance to design, review, and harden Terraform configurations so infrastructure is reproducible, auditable, and safe to operate at scale.

Core Features & Use Cases

  • Module design & review: Advice on one-concern modules, input/output conventions, variable validation, locals, and naming patterns to improve reusability.
  • State & secrets management: Recommendations for remote state backends with locking, encryption, and patterns to avoid committing secrets while enabling team workflows.
  • CI/CD and safety gates: Best practices and example pipelines for plan-on-PR, apply-on-merge, OIDC authentication, -out=tfplan workflows, and drift detection.
  • Use Case: Conduct a repo-wide Terraform audit to surface hardcoded secrets, missing provider pinning, state isolation issues, and prioritized remediation steps for production readiness.

Quick Start

Use the terraform-iac skill to audit the repository's Terraform files and produce a prioritized list of issues and step-by-step remediation actions.

Frequently Asked Questions about terraform-iac

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

FAQPage Schema
How do I audit Terraform code for hardcoded secrets and missing provider pinning?

The best way to structure Terraform modules for multi-environment deployments is by designing one-concern modules with consistent input/output conventions, variable validation, and clear naming patterns to ensure reusability and maintainability.

How do I prevent secrets from leaking into Terraform remote state?

To prevent secrets from leaking into Terraform remote state, use remote state backends with locking and encryption enabled, and implement secure secrets handling patterns to avoid committing sensitive data while enabling team workflows.

How do I set up a safe Terraform CI/CD pipeline with plan-on-PR and apply-on-merge?

To set up a safe Terraform CI/CD pipeline, implement plan-on-PR and apply-on-merge workflows using OIDC authentication and -out=tfplan files, ensuring CI-driven plan and apply safeguards prevent accidental destructive changes.

Why does my Terraform infrastructure experience drift in CI/CD workflows?

Terraform infrastructure experiences drift in CI/CD workflows due to brittle pipelines lacking proper safety gates, missing drift detection mechanisms, and inconsistent state management. Implement CI-driven plan/apply safeguards and remote state locking to resolve this.

Can I use this approach to review IAM least-privilege configurations in HCL codebases?

Yes, you can review IAM least-privilege configurations in HCL codebases by analyzing Terraform configurations during audits to ensure variable validation, proper secrets handling, and secure IAM permissions are enforced across modules.