Open bamhm182 opened 3 days ago
Yeah, this is an unfortunate limitation of the current design. We'd need ConvertState
to intercept resources that use count
and then append whatever index it is to the resource label. I'm not sure if/when this will get prioritised.
Problem
When creating multiple resources within a
count
orfor_each
loop, you end up with multiple resources using the same label as seen in theterraform graph
output. TheConvertState
function withinproviders/terraform/resources.go
sees references to these resources as a problem since they share the same label and fails to let you use them.Use Case
Below is a simple example which creates 5 random passwords and attempts to make
coder_metadata
resources for them. While this instance usescoder_metadata
, a similar result also occurs with many of the othercoder_*
resource types.What I Want
5
coder_metadata
resources, one for each of the generatedrandom_password
resources.What I Get