Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Terraform Plan Blast-Radius & Safe State Surgery

    1

    Catch accidental RDS, VPC, S3, and KMS force-replacements in Terraform plan JSON before apply—and auto-generate zero-downtime moved {} blocks and PR blast-radius cards.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Terraform Plan Blast-Radius & Safe State Surgery

    Terraform Plan Blast-Radius & Safe State Surgery

    Example session with this skill installed

    Analyze plan.json and main.tf before we merge this Terraform VPC & RDS refactor PR. Flag any destructive stateful replacements, generate safe moved {} blocks, and do not edit any files until I approve.

    • Read your context and instructions
    • Compiled the terraform plan blast-radius

    Terraform Plan Blast-Radius Review Card

    Verdict: CRITICAL BLAST RADIUS · Risk Tier: CRITICAL
    Planned Actions: 2 create · 1 update · 2 replace · 2 destroy

    RuleSeverityResourceBlast-Radius ImpactSafe Fix
    TFP-001Criticalaws_db_instance.ordersForce-replacement (engine_version / identifier change) wipes live DBUse blue/green deployment or restore from snapshot; add prevent_destroy = true
    TFP-002Criticalaws_kms_key.app_dataDestroying KMS key permanently invalidates encrypted EBS/RDS/S3 dataKeep existing key; remove destroy or migrate with moved {}
    TFP-003Highaws_subnet.priv[0] → aws_subnet.private["a"]Destroy + create rename pair from count → for_each refactorAdd declarative moved {} block (0 downtime, 0 recreation)
    TFP-005Highaws_security_group.dbPlanned after state opens 0.0.0.0/0 on port 5432Restrict CIDR to private app subnet only

    Auto-Generated moves.tf (Zero-Downtime State Surgery)

    moved {
      from = aws_subnet.priv[0]
      to   = aws_subnet.private["a"]
    }
    

    Next Steps (Approval Required)

    1. Block terraform apply until TFP-001 (RDS) and TFP-002 (KMS) are resolved.
    2. Reply

    "Write moves.tf and lifecycle guards" to apply the safe refactor blocks and re-run terraform plan to confirm 0 to destroy.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop Accidental RDS, VPC, and KMS Force-Replacements Before terraform apply

    Terraform Plan Blast-Radius & Safe State Surgery pairs a zero-dependency, strictly read-only Python plan analyzer (scripts/analyze_tf_plan.py) with senior Terraform state-refactoring playbooks. Point it at terraform show -json tfplan (and your .tf files) to surface stateful destroys, count index-shift traps, security regressions, and exact declarative moved {} / import {} / lifecycle fixes—before a single cloud resource is touched.

    What It Detects (7 High-Impact Rules)

    • TFP-001 (Critical): Destroy or force-replacement of stateful data stores (aws_db_instance, aws_rds_cluster, aws_dynamodb_table, aws_s3_bucket, aws_ebs_volume, google_sql_database_instance, azurerm_postgresql_flexible_server).
    • TFP-002 (Critical): Destroy/replacement of cryptographic, IAM, or core network backbone (aws_kms_key, aws_vpc, aws_subnet, aws_nat_gateway, aws_eks_cluster, aws_iam_role).
    • TFP-003 (High): Destroy + create rename/refactor pairs that can be converted into zero-downtime declarative moved {} blocks.
    • TFP-004 (High): Large blast-radius plans (>10 destroys/replaces) and unexpected replace_paths force-new triggers.
    • TFP-005 (High): Security regressions in planned after state (0.0.0.0/0 on SSH/RDP/DB ports, publicly_accessible: true, storage_encrypted: false).
    • TFP-006 & TFP-007 (Medium): Missing prevent_destroy / create_before_destroy lifecycles and count index-shift traps on stateful resources.

    How to Use

    Generate a plan JSON locally (terraform plan -out=tfplan && terraform show -json tfplan > plan.json) and ask your AI agent:

    • "Analyze plan.json for blast radius and stateful replacements before we apply."
    • "Generate declarative moved {} blocks so this module refactor doesn't destroy our RDS or subnets."

    Or run the bundled read-only script directly:

    python3 scripts/analyze_tf_plan.py --path plan.json --format markdown
    

    What's Inside (15 Files)

    • SKILL.md — 5-step deterministic blast-radius workflow with SAFE / REVIEW REQUIRED / CRITICAL BLAST RADIUS gating
    • scripts/analyze_tf_plan.py — Pure Python 3 stdlib analyzer (--fail-on-critical CI gate, JSON/Markdown output, auto moved {} generation)
    • references/ — Stateful resource risk matrix, declarative moved/import/removed surgery playbook, and rule catalog
    • templates/ & examples/ — PR blast-radius review card, phased state-surgery plan, and worked RDS/VPC audit
    • tests/ — Risky & safe plan JSON fixtures + runnable unit tests

    Security & Privacy Guarantee

    • 100% offline & read-only — never runs terraform apply/destroy/state rm, zero cloud creds, skips .env*, *.tfstate*, and *.tfvars*.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Static analysis of Terraform plan JSON and .tf HCL files; does not execute terraform plan/apply or inspect live cloud provider state.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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 2 days ago

    Software
    Python 3.9+ (stdlib only)

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Bundled analyzer is 100% offline and read-only; skips .env, .tfstate, and .tfvars files. Write Files is only used after explicit user approval to write moves.tf or lifecycle fixes.

    Listed2 days ago

    What's inside

    Frequently Asked Questions

    This skill identifies high-risk actions like force-replacements of databases and VPC outages that are often buried in long plan outputs, preventing accidental data loss or service downtime before they happen.

    The skill is compatible with standard Terraform and OpenTofu environments across AWS, GCP, and Azure; it requires your plan output to be exported in JSON format for the analysis to run.

    No, the analyzer operates as a deterministic, read-only tool that uses a local Python engine to scan your plan.json and HCL files without making external network calls or accessing your live cloud environment.

    You receive the full agent skill configuration, the deterministic Python-based blast-radius analyzer, and the risk matrix templates used to categorize infrastructure changes from 'Safe' to 'Critical.'

    If the skill detects a resource index shift or rename that would trigger a destroy, it generates the exact HCL 'moved', 'import', or 'removed' blocks needed to fix the plan and preserve your state.

    Standard LLM prompts struggle with complex logic like positional 'count' index shifts; this skill uses a specialized rule catalog and static analysis to ensure these subtle, high-risk traps are never missed.

    New in DevOps & Cloud