Blenra LogoBlenra
Optimized for: Gemini / ChatGPT / Claude
#Terraform

Advanced Terraform State Surgery and Refactoring

Customize the variables below to instantly engineer your prompt.

Required Variables

terraform-state-surgery-refactoring.txt
Act as an Expert Terraform Consultant. Generate a highly calculated, extremely dangerous migration plan to safely refactor a chaotic, monolithic infrastructure repository into a strict, DRY modular architecture. Output a precise series of `terraform state mv` commands required to surgically migrate the [CRITICAL_RESOURCES] (e.g., production RDS instances, KMS keys) from the legacy [LEGACY_MODULE_PATH] namespace directly into the newly structured [NEW_MODULE_PATH] without triggering any destructive resource recreation. Write a robust, idempotent bash script that automates this `mv` process for hundreds of resources. Dictate a mandatory pre-flight validation step using `terraform plan -refresh-only` to mathematically guarantee zero pending adds/destroys are queued, definitively proving the state file perfectly matches the cloud reality post-surgery.

Example Text Output

"A masterful step-by-step migration guide and shell script containing specific state manipulation commands, ensuring zero-downtime refactoring of critical cloud infrastructure."

More Cloud & DevOps Prompts

View all →

Frequently Asked Questions

What is the "Advanced Terraform State Surgery and Refactoring" prompt used for?

A masterful step-by-step migration guide and shell script containing specific state manipulation commands, ensuring zero-downtime refactoring of critical cloud infrastructure.

Which AI tools work with this prompt?

This prompt is optimized for Gemini / ChatGPT / Claude, but works great with ChatGPT, Claude, Gemini, and other large language models. Simply copy it and paste it into your preferred AI tool.

How do I customize this prompt?

Use the variable fields above to fill in your specific details. The prompt will auto-update as you type, ready to copy instantly.

Is this prompt free?

Yes! All prompts on Blenra are free to copy and use immediately. No account required.