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
Terraform using -target
on a module does not look up remote states
#16477
Comments
+1. Still the same behaviour for 0.11.2. remote state lookup fails when targetting specific modules, though there's a caveat in 0.10.0 about "not intended for routine use".
|
Is this still an issue? I am trying to target one module that contains a Launch Configuration to use the latest AMI. However, then I target that module, I get 'up-to-date'. But when I take the -target out, terraform checks the remote state and notices there are changes that need to be made. Any idea how I can get around this? |
Bug in the core as flagged above. |
Any news about this? 0.11.11 seems to be affected by this bug too! |
Still an issue on v0.11.13, but the solution proposed in hashicorp/terraform-provider-terraform#17 (comment) worked for me. |
Just hit this myself and noticed that if I explicitly Edit: so to be clear, instead of terraform apply -target=provider.my_resource I run terraform apply -target=provider.my_resource -target=data.terraform_remote_state.shared |
wow, I've spent a bit amount of time debugging my config before ran into this. |
Hi all! Just looking through some older issues today and found this one. Based on the behavior described, this sounds like a bug in 0.11 and earlier where the The relevant parts of Terraform were completely redesign as part of the configuration language revamp in Terraform 0.12, so I strongly suspect that this problem was addressed in 0.12. Even if there is still a similar issue, it would manifest in a very different way under 0.12 because the codepath that produces the error string "Resource A does not have attribute B for variable C" no longer exists in Terraform 0.12. If a similar problem does still exist then someone opening an issue for it would not recognize it as the same root cause as this one, because the observed behavior would be very different. For those reasons, I'm going to close this issue now. If you find that you're facing what seems to be similar behavior in Terraform v0.12 or later, please open a new issue and complete the bug report template so we can see how things are playing out in the new codepaths in the new version. 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. |
Cross referencing hashicorp/terraform-provider-terraform#17
Because i have no clue where this one goes
Terraform Version
0.10.6
Affected Resource(s)
Terraform Configuration Files
in a remote state:
In a top level tf:
Debug Output
On the tf with outputs, apply works and shows the outputs:
Using
terraform apply -target=module.rds
fails and never attempts to look up the remote state outputs:You can see it never did any look ups. Running the same command with no
-target=...
works exactly as expected:Expected Behavior
Able to target resources/modules individually
Actual Behavior
What actually happened?
Steps to Reproduce
See debug output
Important Factoids
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
-target
on a module does not look up remote states terraform-provider-terraform#17The text was updated successfully, but these errors were encountered: