-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcdn.tf
33 lines (30 loc) · 1017 Bytes
/
cdn.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
resource "azurerm_cdn_profile" "web_cdn_profile" {
name = "website-cdn"
location = var.cdn_location
resource_group_name = azurerm_resource_group.web_rg.name
sku = "Standard_Microsoft"
}
resource "azurerm_cdn_endpoint" "web_cdn_endpoint" {
name = var.endpoint
profile_name = azurerm_cdn_profile.web_cdn_profile.name
location = var.cdn_location
resource_group_name = azurerm_resource_group.web_rg.name
global_delivery_rule {
cache_expiration_action {
# Cache website for 10 seconds
behavior = "Override"
duration = var.cache_expiration_time
}
modify_response_header_action {
# Add header to response
action = "Append"
name = "X-Clacks-Overhead"
value = "GNU Terry Pratchett"
}
}
origin_host_header = azurerm_storage_account.web_sa.primary_web_host
origin {
name = "web-origin"
host_name = azurerm_storage_account.web_sa.primary_web_host
}
}