Multiple dependent resources

Hi,

within a Module I’ve got several resources. One of them is a hcloud_server which can optionally be more than one (count). For each of them I’ve got to add an hcloud_server_network. So this is a one-to-one relationship. one hcloud_server have to have a hcloud_server_network. What’s the best way to achive this? Using counts within the resources doesn’t look great. A for_each won’t work, because the servers aren’t known when the for_each loop is created (as far as terraform told me).

Thanks
Marc

Hi @eBeyond,

It’s hard to say anything substantial without seeing a real example to work from. Could you share the relevant parts of your configuration, including what you’ve tried already that led you to the error you saw?