AI Skill MartBrowse skillsPromptsProgramsLearnWhat is a Skill?
← Back to list

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 / file provisioner failures into an exact error → root cause → copy-paste fix lookup.
  • Covers fresh-instance breakage: waiting on cloud-init, debconf prompts hanging apt-get, EACCES volume permissions, missing CREATE DATABASE and idempotent migrations, docker compose build-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 apply validation 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

  1. docker: not found in remote-exec → get a provisioner block with cloud-init status --wait plus a readiness gate.
  2. Containers stuck Restarting after apply → walk through volume ownership (uid 1001), then missing database/migrations.
  3. TLS fails only on staging → replace hardcoded domains with {$VAR} in the Caddyfile and ${VAR:?required} in compose, and verify the cfut_ 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)
  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 AI 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.

  1. Open a terminal and clone the repo: git clone https://github.com/daymade/claude-code-skills.git
  2. Create the skills folder: mkdir -p ~/.claude/skills
  3. Copy just this skill: cp -r claude-code-skills/terraform-skill ~/.claude/skills/
  4. Confirm the references/ files (multi-env-isolation.md, pre-deploy-validation.md, zero-to-deploy-checklist.md) came along.
  5. Restart Claude Code, then ask something like "my remote-exec provisioner says docker: not found" to trigger the skill.
  6. Swap example variable names such as LOBEHUB_DOMAIN for your own project's values.