|
| 1 | +# Azure Front Door (classic) |
| 2 | + |
| 3 | +This template deploys an [Azure Front Door (classic)](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/frontdoor). |
| 4 | + |
| 5 | +## Resources |
| 6 | + |
| 7 | +| Terraform Resource Type | Description | |
| 8 | +| - | - | |
| 9 | +| `azurerm_resource_group` | The resource group for all the deployed resources. | |
| 10 | +| `azurerm_frontdoor` | The Front Door (classic). | |
| 11 | +| `random_id` | A random identifier generator to generate a unique Front Door resource name. | |
| 12 | + |
| 13 | +## Variables |
| 14 | + |
| 15 | +| Name | Description | Default Value | |
| 16 | +|-|-|-| |
| 17 | +| `location` | The location for all the deployed resources. | `westus2` | |
| 18 | +| `resource_group_name` | The name of the resource group to deploy. | `FrontDoor` | |
| 19 | +| `backend_address` | The host name or IP address of the backend application. | | |
| 20 | + |
| 21 | +## Example |
| 22 | + |
| 23 | +```bash |
| 24 | +$ terraform plan -out main.tfplan |
| 25 | + |
| 26 | +Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: |
| 27 | + + create |
| 28 | + |
| 29 | +Terraform will perform the following actions: |
| 30 | + |
| 31 | + # azurerm_frontdoor.my_front_door will be created |
| 32 | + + resource "azurerm_frontdoor" "my_front_door" { |
| 33 | + + backend_pool_health_probes = (known after apply) |
| 34 | + + backend_pool_load_balancing_settings = (known after apply) |
| 35 | + + backend_pools = (known after apply) |
| 36 | + + cname = (known after apply) |
| 37 | + + explicit_resource_order = (known after apply) |
| 38 | + + frontend_endpoints = (known after apply) |
| 39 | + + header_frontdoor_id = (known after apply) |
| 40 | + + id = (known after apply) |
| 41 | + + load_balancer_enabled = true |
| 42 | + + name = (known after apply) |
| 43 | + + resource_group_name = "FrontDoor" |
| 44 | + + routing_rules = (known after apply) |
| 45 | + |
| 46 | + + backend_pool { |
| 47 | + + health_probe_name = "healthProbeSettings" |
| 48 | + + id = (known after apply) |
| 49 | + + load_balancing_name = "loadBalancingSettings" |
| 50 | + + name = "backendPool" |
| 51 | + |
| 52 | + + backend { |
| 53 | + + address = "<your backend hostname>" |
| 54 | + + enabled = true |
| 55 | + + host_header = "<your backend hostname>" |
| 56 | + + http_port = 80 |
| 57 | + + https_port = 443 |
| 58 | + + priority = 1 |
| 59 | + + weight = 50 |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + + backend_pool_health_probe { |
| 64 | + + enabled = true |
| 65 | + + id = (known after apply) |
| 66 | + + interval_in_seconds = 120 |
| 67 | + + name = "healthProbeSettings" |
| 68 | + + path = "/" |
| 69 | + + probe_method = "GET" |
| 70 | + + protocol = "Http" |
| 71 | + } |
| 72 | + |
| 73 | + + backend_pool_load_balancing { |
| 74 | + + additional_latency_milliseconds = 0 |
| 75 | + + id = (known after apply) |
| 76 | + + name = "loadBalancingSettings" |
| 77 | + + sample_size = 4 |
| 78 | + + successful_samples_required = 2 |
| 79 | + } |
| 80 | + |
| 81 | + + frontend_endpoint { |
| 82 | + + host_name = (known after apply) |
| 83 | + + id = (known after apply) |
| 84 | + + name = "frontEndEndpoint" |
| 85 | + + session_affinity_enabled = false |
| 86 | + + session_affinity_ttl_seconds = 0 |
| 87 | + } |
| 88 | + |
| 89 | + + routing_rule { |
| 90 | + + accepted_protocols = [ |
| 91 | + + "Http", |
| 92 | + + "Https", |
| 93 | + ] |
| 94 | + + enabled = true |
| 95 | + + frontend_endpoints = [ |
| 96 | + + "frontEndEndpoint", |
| 97 | + ] |
| 98 | + + id = (known after apply) |
| 99 | + + name = "routingRule" |
| 100 | + + patterns_to_match = [ |
| 101 | + + "/*", |
| 102 | + ] |
| 103 | + |
| 104 | + + forwarding_configuration { |
| 105 | + + backend_pool_name = "backendPool" |
| 106 | + + cache_enabled = false |
| 107 | + + cache_query_parameter_strip_directive = "StripAll" |
| 108 | + + cache_use_dynamic_compression = false |
| 109 | + + forwarding_protocol = "MatchRequest" |
| 110 | + } |
| 111 | + } |
| 112 | + } |
| 113 | + |
| 114 | + # azurerm_resource_group.my_resource_group will be created |
| 115 | + + resource "azurerm_resource_group" "my_resource_group" { |
| 116 | + + id = (known after apply) |
| 117 | + + location = "westus2" |
| 118 | + + name = "FrontDoor" |
| 119 | + } |
| 120 | + |
| 121 | + # random_id.front_door_name will be created |
| 122 | + + resource "random_id" "front_door_name" { |
| 123 | + + b64_std = (known after apply) |
| 124 | + + b64_url = (known after apply) |
| 125 | + + byte_length = 8 |
| 126 | + + dec = (known after apply) |
| 127 | + + hex = (known after apply) |
| 128 | + + id = (known after apply) |
| 129 | + } |
| 130 | + |
| 131 | +Plan: 3 to add, 0 to change, 0 to destroy. |
| 132 | +``` |
0 commit comments