terraform-validator

Validate, format, and security-scan Terraform configurations with Checkov.

290|32|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill terraform-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-validator
Source: https://github.com/akin-ozer/cc-devops-skills/tree/main/devops-skills-plugin/skills/terraform-validator
Command: npx skills add https://github.com/akin-ozer/cc-devops-skills --skill terraform-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python3, python-hcl2, checkov, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Terraform infrastructure code often lacks validation, linting, and security checks, leading to misconfigurations and insecure deployments. The Terraform Validator skill provides a comprehensive toolkit to automatically validate, format, lint, and scan Terraform configurations to detect issues before applying.

Core Features & Use Cases

  • Validate syntax and structure of .tf and .tfvars files across repositories.
  • Lint and format Terraform code to enforce best practices using terraform fmt and tflint where available.
  • Perform security checks with Checkov and automated scans via the provided wrapper scripts.
  • Use with Terraform modules and providers by extracting metadata (providers, modules) for documentation and governance.

Quick Start

Use the terraform-validator to analyze a Terraform project with the included wrappers:

  • Run: bash scripts/extract_tf_info_wrapper.sh <path> to extract metadata
  • Run: bash scripts/run_checkov.sh <path> to perform security scans
  • Review the results and remediation guidance in references.

Frequently Asked Questions about terraform-validator

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

FAQPage Schema
How do I validate Terraform configurations for security gaps and misconfigurations?

To validate Terraform configurations, you can run syntax checks with terraform validate, format with terraform fmt, and scan .tf files for security gaps using Checkov via provided wrapper scripts to prevent insecure deployments.

Can I use Checkov to scan Terraform plan files for governance issues?

Yes, Checkov scans Terraform files including .tfplan for governance issues. The skill uses a dedicated run_checkov.sh wrapper to automate security checks across repositories, extracting metadata to detect misconfigurations before applying.

How do I extract Terraform module and provider metadata for documentation?

You extract Terraform module and provider metadata by running the extract_tf_info_wrapper.sh script. This parses .tf and .tfvars files to output structural information required for documentation and infrastructure governance.

Do I need Python and python-hcl2 to lint Terraform infrastructure code?

Yes, you need python3 and python-hcl2 to lint Terraform infrastructure code. These dependencies parse HCL2 syntax required by the validation scripts and Checkov security scans to accurately analyze configurations.

What is the best way to secure Terraform infrastructure as code across repositories?

The best way to secure Terraform infrastructure as code is applying automated validation pipelines. This skill combines terraform fmt, terraform validate, and Checkov security scans to enforce formatting and detect insecure deployments across repositories.

Why does terraform validate fail on my .tfvars files?

Terraform validate may fail on .tfvars files due to syntax errors or misconfigurations. This skill initializes with terraform init and applies formatting checks to ensure structure and syntax meet best practices before deployment.