Open
Description
Background
While prototyping new Terraform configuration, users may not always be careful in choosing the right names and need to change them later. This is not always a straight-forward process, especially if there is existing state involved.
Typically they expect to begin with
resource "aws_instance" "blablah" {
// ...
}
and end up with
resource "aws_instance" "main" {
// ...
}
moved {
from = aws_instance.blablah
to = aws_instance.main
}
Proposal
- Provide code actions to rename stateful blocks and (optionally?) generate
moved {}
block- Rename
resource
- Rename
data
- Rename
module
- Rename