Constructing resource names within Terraform

Thank you for this! It has worked perfectly for the first case I’ve needed this for.

I have a follow-up question : Accessing resources indirectly