-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Allow setting folder_id on google_project to "" #1419
Comments
This is happening because of the use of Given the use case (it seems like people would want to use modules and parameterize this as part of a larger "thing"), I think it's a good idea to remove the top-level conflicts_with. The other downside is that by moving it to resource time, it won't fail during the plan (but will during the apply). Something to consider... |
I opened an issue against Terraform core a few months ago about this. The answer I got was that HCL2 will introduce a proper concept of For more details, here is the issue I opened: Given that we would lose plan-time validation, I suggest we wait until HCL2. What do you think? |
I'm not convinced that we benefit much from plan-time validation, to be honest. In fact, I would suggest we don't need it at all and could instead switch on a single value (whether folder_id is set or not). I think if folder_id is specified, the desired behavior (being in that folder) is clear, even if org_id is also specified. This is currently causing a fair amount of pain with some key customers. |
I tend to agree with @morgante that the trade-off leans toward giving customers power of extensibility in the short term |
Alright, you convinced me. I will open a PR soon to fix this. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Setting folder_id to "" should have the same behavior as leaving it off entirely.
Actual Behavior
The only way to successfully execute this is to leave folder_id off entirely (and create at org level) or leave off org_id (and create at folder level). This has to be hard-coded in the HCL, making variable creation impossible.
The key code is here: https://github.com/terraform-providers/terraform-provider-google/blob/42b07b30e618d3ceabdd6d36f8a13656f137f528/google/resource_google_project.go#L53-L64
Important Factoids
This is critical to being able to dynamically only set the folder ID based on variables or parameters.
The text was updated successfully, but these errors were encountered: