Works with the AI Agents you already use
Terraform State Operations Safely (mv, import, rm)
by Saizul Amin
This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice.
$9
Terraform State Operations Safely (mv, import, rm)
Example session with this skill installed
Run the Terraform State Operations Safely skill on my project and give me a prioritised list of what to fix, with exact changes.
- Read your context and instructions
- Compiled the terraform state operations
Here is what the Terraform State Operations Safely (mv, import, rm) skill produced.
Demo: real, unedited output of the skill's bundled script on a sample input from its test suite.
Output
# confidence high (score 1.0)
moved {
from = aws_instance.web[0]
to = aws_instance.web["a"]
}
# confidence high (score 1.0)
moved {
from = aws_instance.web[1]
to = aws_instance.web["b"]
}
# confidence medium (score 0.812)
moved {
from = aws_s3_bucket.logs
to = module.storage.aws_s3_bucket.this
}
# UNMATCHED: aws_iam_role.old_name will be destroyed; no create of the same type looks like it
# UNMATCHED: aws_sqs_queue.jobs will be destroyed; no create of the same type looks like it
What you do next
- Fix the highest-severity items first.
- Ask your agent to apply the fixes it suggests, then run the skill again to confirm.
- Keep the skill installed and re-run it whenever the project changes.
Connects securely to your tools. The creator never sees your data.
About this skill
Safely refactor and repair Terraform/OpenTofu state - rename resources, move them into or out of modules, switch count to for_each, split or merge root modules, adopt existing infrastructure, and stop managing resources without destroying them. Prefers declarative moved, import and removed blocks over terraform state mv/rm, always backs up state first and verifies with a plan that shows no destroys. Includes a script that reads plan JSON, pairs each destroy with the matching create and prints ready-to-review moved blocks (or state mv commands), plus generators for import and removed blocks.
Who it's for
Use when a plan wants to destroy and re-create something that was only renamed or moved, when the user asks about terraform state mv, state rm, import, moved blocks, "adopt existing resources", "Terraform wants to recreate everything after a refactor", a stuck state lock or a corrupted state.
What's inside
- Tested, offline Python script(s): state_moves.py (deterministic results, standard library only unless noted)
- Reference guides: blocks.md, runbooks.md
- Step-by-step agent instructions in SKILL.md covering: When to use; When not to use; Safety rules; Workflow
Why it's worth it
Generic prompts guess. This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice. See the real demo below.
Works with every major AI agent
Built on the open SKILL.md standard: Claude Code, Codex CLI, Cursor, VS Code Copilot, Gemini CLI, Windsurf and 20+ other agents.
Requirements
- Python 3.8+ for the bundled scripts
- No API keys, no account, runs locally
Open source: saizul/terraform-iac-skills on GitHub (MIT licence, by Saizul Amin).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
- Software
Python 3.8+