Hi everyone,
I’m looking for advice on the safest workflow to refactor an existing Terraform codebase.
The Scenario: I need to rename several Modules and Resources to match a new naming convention.
The Constraints:
- Zero Downtime: The actual infrastructure must not be destroyed and recreated.
- Remote State: My state file is stored in an S3 backend with locking (DynamoDB).
- No Manual Edits: I want to avoid downloading the state file, editing the JSON manually, and re-
uploading it, as this feels risky and error-prone.
The Question: Is terraform state mv still the standard way to handle this for remote backends, or
has the moved block feature in Terraform 1.1+ completely replaced the need for CLI state
manipulation?
I am looking for a declarative approach if possible. If anyone has experience using the moved blocks
for large-scale refactoring, did you run into any edge cases?
Thanks in advance for your insights!