-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving a module with "terraform state mv" loses "data." prefix for data.aws_redshift_service_account resource #16051
Comments
Hi @Chili-Man! Sorry for this broken behavior. Indeed this does look a lot like #9996. The fix that was added for that does still seem to be in place, so looks like the problem is elsewhere this time. We'll take a look. |
Hi @Chili-Man, What version of Terraform was this run with? I'm not able to reproduce the error you have here. It is expected that renaming the module but not updating the config will "lose" the existing resources, but the data prefix seems to be correct. This exercise does lead to another bug where orphaned module resources aren't destroyed however. I'll have to see if there's another duplicate of that somewhere. |
@apparentlymart , @jbardin +1 on this.
Put explicit .data. in between. |
Do you happen to have an example that reproduces this issue for you? Testing the above with recent versions of Terraform works as expected. |
Hi, I'm facing a similar issue with |
Hi @santi698, Yes, if you have the details to reproduce the issue, please open a new one and I can continue form there. Thanks! |
@jbardin , sorry for late update. Here is how to reproduce the problem.
When I run
With this state, I performed and dest.tfstate look as follow:
You can see
This is with terraform Thank you and let me know if this is uncertain. |
Thanks @seongkki, that gives me exactly what I needed. |
@jbardin Great, would this be in the queue for a fix? Thanks alot |
still hitting this on 0.11.14 |
Hello! 🤖 This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it. If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in this issue, because the internal details relating to this problem are likely to be different in the current version of Terraform. Thanks! |
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. |
Terraform Version
Terraform Configuration Files
Expected Behavior
With the above module layout, after running terraform apply you should be able to rename a module:
terraform apply
terraform state mv module.rs_data module.rs_data_renamed
terraform plan
Actual Behavior
References
As a work around, you can manually add the
data
prefix to the state and that fixes the above issue.This issue is very similar to #9996
The text was updated successfully, but these errors were encountered: