-
Notifications
You must be signed in to change notification settings - Fork 561
Error when using dynamic keys in for_each statements #839
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 when using dynamic keys in for_each statements #839
Comments
Hi @the-real-mathew-moon, PRs for this feature are welcome. |
I would respectfully argue that it is indeed a bug since
But this fails:
Both utilize a provider that was generated with a |
I ran into this issue as well and I found the issue causing this. It is an issue with the imported terraform-config-inspect code. As far as I can tell, there isn't much that can be done in the terraform-docs code base, at least not in a way that is appropriate. |
@the-real-mathew-moon can you please take a look at @crash-bandi 's PR, or help prioritize this? Both opentofu and terraform support for_each providers as of 1.9. The new feature is breaking all of our tfdocs pre-commit hooks. |
Describe the bug
When a resource, datasource or module's provider uses a variable as the key to the a provider generated with a
for_each
statement the following error is returned:How can we reproduce it?
Use a for_each statement to generate a provider, then reference the provider using something dynamic, such as a variable, local, etc.
Environment information
Terraform Docs version:
OS: MacOS Sonoma 14.7 on Apple M3 Pro
The text was updated successfully, but these errors were encountered: