azurerm_maintenance_assignment_virtual_machine
- maintenance configuration is now obtained by name rather than using the first in the list
#20766
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.
fixes #20705
Currently TF always set
maintenance_configuration_id
with the first one of maintenance configuration in the list when one vm is linked by two maintenance configurations. So TF would cause diff after first apply. I assume we should check and setmaintenance_configuration_id
by the name of maintenance configuration list.And I found seems TF only checks if the vm is linked maintenance configuration while checking if
azurerm_maintenance_assignment_virtual_machine
exists. If such, one vm cannot be linked again per current TF behavior. So I assume it's unexpected. Per my undestanding, we should check the name of maintenance configuration in the list to see if the resource exists.