I'm trying to create an application gateway (Standard V2) with both public IP and private IP configuration, but upon creation only public IP is being created and private IP configuration is nowhere to be found. I don't see any mistake in my terraform code at all. I'm not sure where I'm missing things.Below is my terraform code.
provider "azurerm" {
version = "=1.44"
}
provider "null" {
version = "=2.1"
}
resource "azurerm_public_ip" "appgwip" {
name = "appgwtestpip"
location = "Southeast Asia"
resource_group_name = "myrgname"
allocation_method = "Static"
sku = "Standard"
}
resource "azurerm_application_gateway" "appgw" {
depends_on = [azurerm_public_ip.appgwip]
name = "testappgw-sea"
resource_group_name = "myrgname"
location = "Southeast Asia"
sku {
name = "Standard_v2"
tier = "Standard_v2"
capacity = 2
}
gateway_ip_configuration {
name = "APPGW-IPCONFIG-test"
subnet_id = "mysubnetid"
}
frontend_port {
name = "Httpport"
port = 80
}
frontend_ip_configuration {
name = "AppgwPIPConfig"
public_ip_address_id = azurerm_public_ip.appgwip.id
private_ip_address = "An IP address within the subnet range"
private_ip_address_allocation = "Static"
}
backend_address_pool {
name = "test-bp"
{
name = "test-listener-80"
frontend_ip_configuration_name = "AppgwPIPConfig"
frontend_port_name = "Httpport"
protocol = "Http"
}
request_routing_rule {
name = "test-rule01"
rule_type = "Basic"
http_listener_name = "test-listener-80"
backend_address_pool_name = "test-bp"
backend_http_settings_name = "test-http"
}
}