Open jacky9813 opened 6 months ago
A new resource like azurerm_lb_backend_address_pool_vmss_assignment
would be really helpful, as this new resource can be set to depend on the existence of azurerm_lb_backend_address_pool
, for example:
resource "azurerm_lb_backend_address_pool_vmss_assignment" "example-be-address-pool-vmss" {
pool_id = azurerm_lb_backend_address_pool.example-be-address-pool.id
scale_set_id = azurerm_linux_virtual_machine_scale_set.example-vmss.id
}
This resource should be replaced when the value of either pool_id
or scale_set_id
is changed, which should make Terraform destroy this relationship first before destroying backend address pool.
Is there an existing issue for this?
Community Note
Terraform Version
1.7.4
AzureRM Provider Version
3.93.0
Affected Resource(s)/Data Source(s)
azurerm_linux_virtual_machine_scale_set, azurerm_lb_backend_address_pool
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Similar result will also occur for application gateway as well.
Actual Behaviour
Terraform tries to remove backend address pool, which is in use at the moment, and failed to do so.
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
No response
References
No response