Open ashleysommer opened 1 month ago
Thank you for taking the time to open this issue. #25959 has been merged and should be released soon, if you're able to upgrade once it is released and let us know if this issue is resolved that would be much appreciated!
@rcskosir I've just upgraded to release v3.104.0, which contains the changes from #25959 and I'm still seeing the same error as in the initial report.
CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool: Mixing backend ipconfigurations and IPAddresses in backend pool
For what its worth, I also downgraded to v3.85.0 yesterday to see if that helps, and I'm seeing the same error on that version too.
This could well still be something wrong with my understanding of how to use azurerm_network_interface_backend_address_pool_association
(as seen in my provided terraform files), but I'm struggling to see where my mistake is, it should be a straightforward operation.
@rcskosir
I found that if I remove the virtual_network_id
from my lb_backend_address_pool
then my problem resolves itself.
I was wondering why virtual_network_id
is an "optional" attribute, and it seems that if you specify a virtual_network_id
on the lb_backend_address_pool
then it puts the address pool in "IPAddress" mode. But if you don't supply the virtual_network_id
, then the pool allows you to add NIC IPConfiguration Associations as I wanted.
resource "azurerm_lb_backend_address_pool" "my_lb_backend_pool" {
name = "lb-backend-pool-1"
loadbalancer_id = azurerm_lb.my_lb.id
#virtual_network_id = azurerm_virtual_network.my_vnet.id <-- remove this
}
I wonder if this is a recent change, or has always been like that? Does it need to be put in the documentation?
Is there an existing issue for this?
Community Note
Terraform Version
1.8.3
AzureRM Provider Version
3.103.1
Affected Resource(s)/Data Source(s)
azurerm_network_interface_backend_address_pool_association
Terraform Configuration Files
This Gist shows a minimal reproduction of the error: https://gist.github.com/ashleysommer/7a9d62eb3dbc770118e95d4d963da940
Debug Output/Panic Output
This Gist contains the relevant debug output: https://gist.github.com/ashleysommer/4a6767bd3b774eebb2b3f7718926e850
Expected Behaviour
I'm trying to assign my VM's NIC to a Load-Balancer Backend Address Pool using
azurerm_network_interface_backend_address_pool_association
, I followed the docs forazurerm_network_interface_backend_address_pool_association
as well as other example implementations and guides, I believe I've configured it correctly.Actual Behaviour
Azure fails to associate the NIC to the Load-balancer's Backend Address Pool.
The error indicates mixing IP-based addresses and IP Configurations on the LoadBalancer Backend Address Pool, however notice in the example I'm only adding a single item, that is a NIC IP Configuration to the Backend Address Pool.
Steps to Reproduce
Use minimal reproduction supplied, run
terraform apply
.Important Factoids
No response
References
Seems like a recent issue with the Azure backend? Searching google for "CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool" only shows hits starting from the last 48 hours. Searching this issue tracker and other issue trackers shows no reference to this error being reported before.
This may be fixed by https://github.com/hashicorp/terraform-provider-azurerm/pull/25959 ?