You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform is overly aggressive on name matching when doing state mv commands resulting in resources being lost in my state. If I have aws_vpc.main[0] and aws_vpc.main[1] in my state, and state mv aws_vpc.main without the brackets my first vpc is moved and the rest are removed from my state.
Terraform Version
$ ~/Downloads/terraform-0.7-rc3/terraform version
Terraform v0.7.0-rc3 (3f4857a07a24f3c9e2db6b4458fbf5be19a8b256)
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 23, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform is overly aggressive on name matching when doing
state mv
commands resulting in resources being lost in my state. If I haveaws_vpc.main[0]
andaws_vpc.main[1]
in my state, andstate mv aws_vpc.main
without the brackets my first vpc is moved and the rest are removed from my state.Terraform Version
Affected Resource(s)
All resources I believe.
Terraform Configuration Files
https://gist.github.com/clstokes/d1b7cc64a310dd7d2e29d7176e613bf3#file-main-tf
Debug Output
https://gist.github.com/clstokes/d1b7cc64a310dd7d2e29d7176e613bf3#file-log-log
Expected Behavior
Terraform show have exited with an error that the resource was not found or that more than one resource was found.
Actual Behavior
Terraform moved the first resource it found and removed the others.
Steps to Reproduce
terraform apply
terraform state list
<- See 2 VPCsterraform state mv aws_vpc.main aws_vpc.renamed
<- See only 1 VPC remainsThe text was updated successfully, but these errors were encountered: