Complete the code to create an Azure Load Balancer resource.
resource "azurerm_lb" "example" { name = "example-lb" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name sku = "[1]" }
The Standard SKU is recommended for high availability because it supports zone redundancy and better performance.
Complete the code to define an availability set with fault domains.
resource "azurerm_availability_set" "example" { name = "example-avset" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name platform_fault_domain_count = [1] platform_update_domain_count = 5 }
Setting platform_fault_domain_count to 3 distributes VMs across three fault domains for high availability.
Fix the error in the Azure Traffic Manager profile configuration.
resource "azurerm_traffic_manager_profile" "example" { name = "example-tm" resource_group_name = azurerm_resource_group.example.name location = "global" profile_status = "Enabled" traffic_routing_method = "[1]" dns_config { relative_name = "exampletm" ttl = 30 } }
The correct traffic routing method is Weighted (case-sensitive) to distribute traffic evenly.
Fill both blanks to configure a virtual machine scale set with automatic upgrade policy.
resource "azurerm_linux_virtual_machine_scale_set" "example" { name = "example-vmss" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name upgrade_policy_mode = "[1]" automatic_os_upgrade_policy { enable_auto_os_upgrade = [2] } }
Setting upgrade_policy_mode to Automatic enables automatic upgrades, and enable_auto_os_upgrade must be true to activate it.
Fill all three blanks to define a health probe and backend pool for an Azure Application Gateway.
resource "azurerm_application_gateway" "example" { name = "example-appgw" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name backend_address_pool { name = "[1]" } probe { name = "[2]" protocol = "[3]" host = "localhost" path = "/health" interval = 30 timeout = 30 unhealthy_threshold = 3 } }
The backend pool is named backendPool1, the probe is named healthProbe1, and the protocol is Http for health checks.