GOT IT....
As I have given the name of backend_http_setting_name = demo-http-settings
and giving it as demo-http-setting
in request_routing_rule
. It will error out as it can't find the backend http setting.
Thank you!
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Below is the terraform code which I am using to deploy WAF-2 appGW and provided all the required code for the certificate and all even though it's getting error .
this is the error:
Error: creating Application Gateway: (Name "appgw-appgw-v2-eastus" / Resource Group "rg-test-01"): network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidResourceReference" Message="Resource /subscriptions/7674bdf6-953a-4f69-b581-219e134c9a73/resourceGroups/rg-test-01/providers/Microsoft.Network/applicationGateways/appgw-appgw-v2-eastus/sslCertificates/ssl_cert_name referenced by resource /subscriptions/7674bdf6-953a-4f69-b581-219e134c9a73/resourceGroups/rg-test-01/providers/Microsoft.Network/applicationGateways/appgw-appgw-v2-eastus/httpListeners/listenertest was not found. Please make sure that the referenced resource exists, and that both resources are in the same region." Details=[]
dynamic "frontend_port" {
for_each = var.frontend_port_config
content {
name = frontend_port.value.name
port = frontend_port.value.port
}
}
ssl_policy {
policy_name = var.ssl_policy["policy_type"] == "Predifined" ? var.ssl_policy["Policy_name"] : null
policy_type = var.ssl_policy["policy_type"]
cipher_suites = var.ssl_policy["policy_type"] == "Custom" ? var.ssl_policy["cipher_suites"] : null
min_protocol_version = var.ssl_policy["policy_type"] == "Custom" ? "TLSv1_2" : null
}
dynamic "ssl_certificate" {
for_each = var.ssl_certificate_config
content {
name = ssl_certificate.value.ssl_certificate_name
#data = ssl_certificate.value.secret_id ? null : "${filebase64(ssl_certificate.value.ssl.ssl_cert_path)}"
#data = "${base64encode(file("/Users/thirumaldage/Desktop/cert.crt"))}"
#key_vault_secret_id = ssl_certificate.key_vault_secret_id ? data.azurerm_key_valut_certificate.certificate[ssl_certificate.key].secret_id : null
key_vault_secret_id = data.azurerm_key_vault_certificate.certificate.secret_id
}
}
identity {
type = "UserAssigned"
#identity_ids = [azurerm_user_assigned_identity.identity.id]
identity_ids = [data.azurerm_user_assigned_identity.identity.id]
}
dynamic "http_listener" {
for_each = var.http_routing_config
content {
name = http_listener.value.http_listener_name
host_name = http_listener.value.http_listener_host_name
frontend_ip_configuration_name = local.private_frontend_ip_configuration_name
frontend_port_name = http_listener.value.frontend_port_name
protocol = "Https"
ssl_certificate_name = http_listener.value.ssl_certificate_name
require_sni = true
}
}
dynamic "request_routing_rule" {
for_each = var.http_routing_config
content {
name = request_routing_rule.key
rule_type = "Basic"
http_listener_name = request_routing_rule.value.http_listener_name
backend_address_pool_name = request_routing_rule.value.backend_address_pool_name
priority = request_routing_rule.value.priority
backend_http_settings_name = "${request_routing_rule.key}-backend-setting"
rewrite_rule_set_name = request_routing_rule.value.rewrite_rule_set_name
}
}
dynamic "trusted_root_certificate" {
for_each = var.trusted_root_certificate
content {
name = trusted_root_certificate.key
data = base64encode(file("${trusted_root_certificate.value}"))
}
}
GOT IT....
As I have given the name of backend_http_setting_name = demo-http-settings
and giving it as demo-http-setting
in request_routing_rule
. It will error out as it can't find the backend http setting.
Thank you!