Terraform Operational Traps
A battle-tested playbook that maps real Terraform provisioner and multi-environment failures to exact root causes and copy-paste fixes.
AutomationAdvanced★ 1,323⑂ 212AI score 8/10Last updated: Aug 8, 2026
What it does
- Turns common
null_resource/remote-exec/local-exec/fileprovisioner failures into an exact error → root cause → copy-paste fix lookup. - Covers fresh-instance breakage: waiting on cloud-init, debconf prompts hanging
apt-get,EACCESvolume permissions, missingCREATE DATABASEand idempotent migrations,docker composebuild-arg gotchas. - Documents multi-environment isolation traps: globally unique resources that collide, duplicate DNS A records causing ~50% misrouted traffic, and snapshot cross-contamination between environments.
- Provides a pre-
terraform applyvalidation checklist (hardcoded domains, required env vars, Cloudflare API Token vs Global Key, DNS records, SSH key).
Who it's for
- Infra/DevOps engineers who provision VMs with Terraform and run Docker Compose stacks on them.
- Teams running a Caddy gateway with Cloudflare DNS-01 ACME certificates.
- Anyone stuck on "production works but the new staging environment fails".
Examples
docker: not foundinremote-exec→ get a provisioner block withcloud-init status --waitplus a readiness gate.- Containers stuck
Restartingafter apply → walk through volume ownership (uid 1001), then missing database/migrations. - TLS fails only on staging → replace hardcoded domains with
{$VAR}in the Caddyfile and${VAR:?required}in compose, and verify thecfut_API token format.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/daymade/claude-code-skills/HEAD/terraform-skill/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the 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 /tmp/claude-code-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-skills/terraform-skill ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/daymade/claude-code-skills.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r claude-code-skills/terraform-skill ~/.claude/skills/ - Confirm the
references/files (multi-env-isolation.md, pre-deploy-validation.md, zero-to-deploy-checklist.md) came along. - Restart Claude Code, then ask something like "my remote-exec provisioner says docker: not found" to trigger the skill.
- Swap example variable names such as
LOBEHUB_DOMAINfor your own project's values.
View source on GitHub ↗License: MIT