terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Additional note on usage of single quotes for for_each resources

Open irab opened this issue 3 years ago • 3 comments

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 avatar Jun 19 '22 09:06 irab

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Jun 19 '22 09:06 hashicorp-cla

@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!

laurapacilio avatar Oct 25 '22 15:10 laurapacilio

Sorry, had missed your comment previously. Hope it's ok now.

irab avatar Oct 25 '22 22:10 irab

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

github-actions[bot] avatar Nov 09 '22 16:11 github-actions[bot]

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.

github-actions[bot] avatar Dec 10 '22 02:12 github-actions[bot]