-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Error in Terraform 0.12.0: This object has no argument, nested block, or exported attribute #21442
Comments
|
Hi @ameyaptk! I'm glad the upgrade tool fixed it. I just wanted to note what it changed that made this work: In Terraform 0.12, the outputs from Specifically, the upgrade tool would rewrite the following line: folder_id = "${data.terraform_remote_state.folders.folder_shared_id}" As well as using the first-class expression syntax, it also added folder_id = data.terraform_remote_state.folders.outputs.folder_shared_id The purpose of grouping them all together into one attribute like this is so that you can, where appropriate, use the entire collection together as a value. |
Thank you very much @apparentlymart Currently I have a problem created by the terraform_remote_state. I have one folder where I create my GCP VPC
with the output
and a folder for my cloudsql with following code:
both folders save the tfstate in the same bucket but with a different prefix: vpc:
cloudsql:
now everytime I want to apply my terraform plan for the cloudsql, to add that ip-address to my vpc, my terraform wants to destroy the vpc but add the ip-address
|
Hi @relgisri, That problem doesn't seem related to this issue. It looks like somehow those two configurations are being applied against the same state, and so the second operation is planning to destroy the objects created by the first. Please note that we use GitHub issues for tracking bugs and enhancements rather than for questions. While we may be able to help with certain simple problems here it's better to use the community forum, where there are more people ready to help. The GitHub issues here are generally monitored only by our few core maintainers. |
Thanks @apparentlymart. This ".outputs" hint fixed everything. I really wish error messages from terraform could suggest something like, "Did you forget to reference the .outputs. array?" or some other intelligent error messages. I wasted 2 hours trying to understand what's wrong with it. |
Thanks @basilmusa , got same issue, I can confirm this fix as well. With terraform 0.12+, we have to add extra data.terraform_remote_state.vpc. |
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
0.12.0
Issue
Hi, when I run terraform plan on one of the config files, I get the following error
Here is the
main.tf
fileHowever, that attribute is present in the
terraform.tfstate
fileThis used to work in Terraform 0.11.13 but broke in Terraform 0.12.0. Any ideas why this is happening?
The text was updated successfully, but these errors were encountered: