terraform
terraform copied to clipboard
Additional note on usage of single quotes for for_each resources
The terraform state show command doesn't normally need quotes around the resource name to return information. But when querying resources that have been created by the use of for_each - which creates resource identifiers such as module.thing[\"item\"] - the command fails to find the the resource. The documentation does show the use of single quotes but this can be easily missed when reading the documentation.
I would be nice to have this highlighted a bit more as this is very subtle and can be missed when you are used to the command working without wrapping single quotes.
Also, I haven't found a way to show these resources with the terraform console yet either.
@irab - Did you still want to get this change merged in? If so, would you mind adding in the last edit I had for formatting? Then I can work on getting it added to our docs - thank you!
Sorry, had missed your comment previously. Hope it's ok now.
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.