Skip to content

Commit 1ac986c

Browse files
committed
add azure front door
1 parent 9dc7310 commit 1ac986c

File tree

2 files changed

+56
-2
lines changed

2 files changed

+56
-2
lines changed

ci/terraform/main.tf

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,59 @@ resource "azurerm_storage_account" "storeacc" {
1313
location = azurerm_resource_group.site.location
1414
account_tier = "Standard"
1515
account_replication_type = "ZRS"
16+
allow_blob_public_access = true
1617

1718
static_website {
1819
index_document = "index.html"
1920
}
2021
}
2122

22-
output "container" {
23-
value = azurerm_storage_account.storeacc.primary_web_host
23+
locals {
24+
frontend_endpoint = "pandas-prs"
25+
backend_pool = "container"
26+
load_balancing = "pandas-prs"
27+
health_probe = "pandas-prs"
28+
}
29+
30+
resource "azurerm_frontdoor" "prs" {
31+
name = "pandas-prs"
32+
resource_group_name = azurerm_resource_group.site.name
33+
enforce_backend_pools_certificate_name_check = false
34+
35+
routing_rule {
36+
name = "exampleRoutingRule1"
37+
accepted_protocols = ["Http", "Https"]
38+
patterns_to_match = ["/*"]
39+
frontend_endpoints = [local.frontend_endpoint]
40+
forwarding_configuration {
41+
forwarding_protocol = "MatchRequest"
42+
backend_pool_name = local.backend_pool
43+
}
44+
}
45+
46+
backend_pool_load_balancing {
47+
name = local.load_balancing
48+
}
49+
50+
backend_pool_health_probe {
51+
name = local.health_probe
52+
}
53+
54+
backend_pool {
55+
name = local.backend_pool
56+
backend {
57+
host_header = azurerm_storage_account.storeacc.primary_web_host
58+
address = azurerm_storage_account.storeacc.primary_web_host
59+
http_port = 80
60+
https_port = 443
61+
}
62+
63+
load_balancing_name = local.load_balancing
64+
health_probe_name = local.health_probe
65+
}
66+
67+
frontend_endpoint {
68+
name = local.frontend_endpoint
69+
host_name = "pandas-prs.azurefd.net"
70+
}
2471
}

ci/terraform/outputs.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
output "container" {
2+
value = azurerm_storage_account.storeacc.primary_web_host
3+
}
4+
5+
output "front_door" {
6+
value = azurerm_frontdoor.prs.frontend_endpoint[0].host_name
7+
}

0 commit comments

Comments
 (0)