So basically, the SKU which you are setting it to Standard. What Azure prefer is the SKU of Public IP should match with SKU of load balancer. And both should be set it on Basic. Below is the code:
#Create public ip for load balancer
resource "azurerm_public_ip" "#{application}##{vertical}#PublicIPforLB" {
name = "lbip#{application}##{vertical}#"
location = azurerm_resource_group.#{application}##{vertical}#ResourceGroup.location
resource_group_name = azurerm_resource_group.#{application}##{vertical}#ResourceGroup.name
allocation_method = "Static"
sku = "Standard"
}
#Create load balancer for 2 front-end web server VMs
resource "azurerm_lb" "#{application}##{vertical}#LoadBalancer" {
name = "lb#{application}##{vertical}#"
location = azurerm_resource_group.#{application}##{vertical}#ResourceGroup.location
resource_group_name = azurerm_resource_group.#{application}##{vertical}#ResourceGroup.name
sku = "Standard"
frontend_ip_configuration {
name = "ipconfLB"
public_ip_address_id = azurerm_public_ip.#{application}##{vertical}#PublicIPforLB.id
}
}
I hope this will help.
Want to become an Azure expert? join azure architect certification now!!