debug:terraform

Diagnose Terraform state locks, provider authentication failures, drift, and module conflicts.

9|1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin --skill debug-terraform
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug:terraform
Source: https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin/tree/main/plugins/debug-and-refactor/skills/debug-terraform
Command: npx skills add https://github.com/SnakeO/claude-debug-and-refactor-skills-plugin --skill debug-terraform

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams diagnose and resolve Terraform infrastructure-as-code issues, including state lock conflicts, provider authentication failures, drift, import failures, module version conflicts, and plan/apply errors. It provides TF_LOG debugging, terraform console usage, state manipulation commands, and CI/CD best practices for infrastructure automation.

Core Features & Use Cases

  • Phase-based debugging workflow for Terraform, covering reproduction, root cause analysis, fix, and prevention.
  • Guidance on enabling debug logs (TF_LOG), isolating problems, and using terraform plan/validate/show.
  • Practical commands and patterns for handling state drift, locks, imports, module versions, and provider authentication.

Quick Start

Run a diagnostic on a failing Terraform configuration by enabling TF_LOG=DEBUG and running terraform plan, then summarize the root cause and recommended fixes.

Frequently Asked Questions about debug:terraform

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

FAQPage Schema
How do I debug Terraform state lock conflicts and provider authentication failures?

Debug Terraform state lock conflicts and provider authentication failures by enabling TF_LOG=DEBUG to capture detailed logs, then inspect state manipulation commands and provider credentials to isolate the root cause.

What is the best way to resolve Terraform plan and apply errors in a CI/CD pipeline?

Resolve Terraform plan and apply errors in CI/CD pipelines by following a phase-based debugging workflow covering reproduction, root cause analysis, fix, and prevention using terraform plan and validate.

How do I fix Terraform state drift and import failures?

Fix Terraform state drift and import failures using practical state inspection and manipulation commands like terraform show and state operations to reconcile infrastructure configuration with actual state.

How do I use TF_LOG to diagnose Terraform infrastructure-as-code issues?

Use TF_LOG to diagnose Terraform infrastructure-as-code issues by setting TF_LOG=DEBUG, running terraform plan, and analyzing the generated logs to identify module version conflicts, drift, or provider errors.

Does this workflow handle Terraform module version conflicts and multi-environment deployments?

This workflow handles Terraform module version conflicts and multi-environment deployments by applying state inspection, terraform console usage, and CI/CD best practices to diagnose and resolve configuration issues end-to-end.

Why does my Terraform configuration fail during local development despite passing validation?

Terraform configurations can fail during local development due to state drift, provider authentication errors, or module conflicts; use terraform console and state inspection commands to isolate and resolve the specific failure.