Use-case: Create X amount of VM’s with a public ip assigned to each VM.
Research so far has found a previous issue ticket created - dated 2017. (https://github.com/hashicorp/terraform/issues/15285) where @apparentlymart discussed this issue.
The fix was that in terraform v0.12 explicit support was added for individual constants being added for reference in a depends_on.
My Repo: https://github.com/CPWu/terraform_azure_compute
Attempting to create a module that will create X number of azure linux computes, the first VM is created perfectly but the second compute unit on a “2X” request does not get created properly. The dynamic IP is created but does not get assigned to the NIC that’s associated to the second VM. My understanding is that because the count’ed’ resources are being seen as a single node and the IP is not available at time of NIC creation. Looked into the for_each construct implemented in v0.12.6 but that doesn’t look like that will solve my issue.
Update: I can see that all the resources are created but IP[1] and so moving forward do not get the association to the respective server NIC. I also posted on Hashicorp community forums with no response yet.