r/datastore_cluster_vm_anti_affinity_rule: New resource #520
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This contains the full CRUD/tests/docs for the
vsphere_datastore_cluster_vm_anti_affinity_rule
resource.One thing to note here - during testing, it was found that a
virtual_machine_ids
length of less than 2 is essentially a no-op on thecluster, resulting in no rules created. This was causing issues where
the apply was succeeding but no rule was being returned, resulting in
odd errors post-creation. In addition to this, we cannot restrict this
with
MinItems
, as there currently seems to be an issue calculating thelength of a glob of computed values - ie:
vsphere_virtual_machine.vm.*.id
, even when thecount
invsphere_virtual_machine
is static.If I'm assuming correctly, this is because when the computed/unknown
value is seen, the entire field becomes unknown with a length of 1,
regardless of if the final length is known beforehand.
Further reading can be found at:
hashicorp/terraform#14677 (comment)