The implementation in #54 works for the majority of use cases, however, I noticed that if a VIF is disconnected terraform doesn't realize that it needs to be reattached. I believe this is related to the attached attribute being computed. I tried to make the attribute optional and have a default value but that seemed to cause issues with existing VIFs (terraform thought they needed to be recreated). I think the solution is to investigate using a CustomDiff function but that will require more work to figure out. Since that PR adds a significant amount of new functionality despite this minor issue I'm going to follow up with this after #54 is merged.
The implementation in #54 works for the majority of use cases, however, I noticed that if a VIF is disconnected terraform doesn't realize that it needs to be reattached. I believe this is related to the
attached
attribute being computed. I tried to make the attribute optional and have a default value but that seemed to cause issues with existing VIFs (terraform thought they needed to be recreated). I think the solution is to investigate using a CustomDiff function but that will require more work to figure out. Since that PR adds a significant amount of new functionality despite this minor issue I'm going to follow up with this after #54 is merged.