Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

Terraform Operational Traps

A battle-tested playbook mapping real Terraform provisioner, multi-environment, and first-deploy failures to copy-paste fixes.

Dev & CodingAdvanced1,323212AI score 7/10Last updated: Aug 8, 2026

What it does

This skill encodes real infrastructure incidents as exact error → root cause → copy-paste fix. Claude Code pulls it in automatically when you write Terraform code or debug a failing terraform apply.

Coverage highlights:

  • Provisioner traps: docker: not found when cloud-init is still running, rsync connection drops in local-exec, cloud-init hanging on debconf prompts, set -e hiding diagnostic logs
  • Container failures: volume ownership (EACCES, uid 1001), Restarting loops from missing databases/migrations, compose build args that only work from .env
  • TLS & domains: why Caddy DNS-01 ACME needs a Cloudflare API Token (cfut_) instead of a Global API Key; parameterizing hardcoded domains with {$VAR} / ${VAR:?required}
  • Multi-environment isolation: table of globally unique resources, duplicate DNS A records sending ~50% of traffic to the wrong instance, snapshot cross-contamination
  • Pre-deploy validation: a 7-point local checklist to run before terraform apply

Who it's for

  • Engineers configuring remote hosts with remote-exec/local-exec/file provisioners
  • Teams running staging and production from one Terraform codebase
  • Operators deploying Docker Compose + Caddy gateway + Cloudflare DNS stacks
  • DevOps folks trying to kill the deploy → discover → fix → redeploy loop

Examples

  1. terraform apply fails with docker: not found in remote-exec → Claude suggests a provisioner block gated by cloud-init status --wait.
  2. TLS works in production but fails in staging → it walks through hardcoded domains in the Caddyfile and verifies the Cloudflare credential format.
  3. Before spinning up a second environment → it greps .tf files for globally unique names (SSH keys, log projects, DNS records) and renames them with an ${env}- prefix.

· · · Install guide · · ·

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the terraform-skill folder from the GitHub repo daymade/claude-code-skills into my ~/.claude/skills/terraform-skill/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/daymade/claude-code-skills.git && mkdir -p ~/.claude/skills && cp -r claude-code-skills/terraform-skill ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal and move to a scratch directory: cd ~/Downloads
  2. Clone the repository: git clone https://github.com/daymade/claude-code-skills.git
  3. Create the skills directory if needed: mkdir -p ~/.claude/skills
  4. Copy the skill folder: cp -r claude-code-skills/terraform-skill ~/.claude/skills/
  5. Confirm the references/ docs came along: ls ~/.claude/skills/terraform-skill
  6. Restart Claude Code, then ask something like "my terraform remote-exec fails with docker: not found" to trigger the skill.