@@ -24,17 +24,17 @@ resource "azurerm_cdn_frontdoor_profile" "fd_profile" {
2424
2525# Endpoint
2626resource "azurerm_cdn_frontdoor_endpoint" "fd_endpoint" {
27- name = var. name
27+ name = var. name
2828 cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile. fd_profile . id
2929}
3030
3131# Custom domains
3232resource "azurerm_cdn_frontdoor_custom_domain" "fd_custom_domains" {
33- for_each = { for custom_domain in var . custom_domains : custom_domain . name => custom_domain }
34-
35- name = each. key
33+ for_each = { for custom_domain in var . custom_domains : custom_domain . name => custom_domain }
34+
35+ name = each. key
3636 cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile. fd_profile . id
37- host_name = each. value . host_name
37+ host_name = each. value . host_name
3838
3939 tls {
4040 certificate_type = " ManagedCertificate"
@@ -43,9 +43,9 @@ resource "azurerm_cdn_frontdoor_custom_domain" "fd_custom_domains" {
4343
4444# Origin groups
4545resource "azurerm_cdn_frontdoor_origin_group" "fd_origin_groups" {
46- for_each = { for group in var . origin_groups : group . name => group }
46+ for_each = { for group in var . origin_groups : group . name => group }
4747
48- name = each. key
48+ name = each. key
4949 cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile. fd_profile . id
5050
5151 session_affinity_enabled = false
@@ -57,28 +57,28 @@ resource "azurerm_cdn_frontdoor_origin_group" "fd_origin_groups" {
5757 request_type = each. value . health_probe . request_type
5858 }
5959
60- load_balancing { }
60+ load_balancing {}
6161}
6262
6363# Origins
6464resource "azurerm_cdn_frontdoor_origin" "fd_origins" {
6565 for_each = {
6666 for group in var . origin_groups :
67- group.name = > group.origins[0 ] # assumes 1 origin per origin group (can be expanded)
67+ group.name = > group.origins[0 ] # assumes 1 origin per origin group (can be expanded)
6868 }
6969
7070 name = each. key
7171 cdn_frontdoor_origin_group_id = azurerm_cdn_frontdoor_origin_group. fd_origin_groups [each . key ]. id
72-
72+
7373 certificate_name_check_enabled = false
7474
75- host_name = each. value . host_name
76- http_port = each. value . http_port
77- https_port = each. value . https_port
78- origin_host_header = each. value . origin_host_header
79- priority = each. value . priority
80- weight = each. value . weight
81- enabled = each. value . enabled
75+ host_name = each. value . host_name
76+ http_port = each. value . http_port
77+ https_port = each. value . https_port
78+ origin_host_header = each. value . origin_host_header
79+ priority = each. value . priority
80+ weight = each. value . weight
81+ enabled = each. value . enabled
8282}
8383
8484# Redirect Rule Set
@@ -118,11 +118,11 @@ resource "azurerm_cdn_frontdoor_route" "fd_redirect_routes" {
118118 cdn_frontdoor_rule_set_ids = [azurerm_cdn_frontdoor_rule_set . fd_rs_redirect . id ]
119119 cdn_frontdoor_custom_domain_ids = [azurerm_cdn_frontdoor_custom_domain . fd_custom_domains [each . value . custom_domain_name ]. id ]
120120
121- enabled = each. value . enabled
122- patterns_to_match = each. value . patterns_to_match
123- supported_protocols = each. value . supported_protocols
124- https_redirect_enabled = false
125- link_to_default_domain = false
121+ enabled = each. value . enabled
122+ patterns_to_match = each. value . patterns_to_match
123+ supported_protocols = each. value . supported_protocols
124+ https_redirect_enabled = false
125+ link_to_default_domain = false
126126}
127127
128128# Routes (forwarding)
@@ -136,25 +136,25 @@ resource "azurerm_cdn_frontdoor_route" "fd_forwarding_routes" {
136136 cdn_frontdoor_origin_group_id = azurerm_cdn_frontdoor_origin_group. fd_origin_groups [each . value . origin_group_name ]. id
137137 cdn_frontdoor_origin_ids = [azurerm_cdn_frontdoor_origin . fd_origins [each . value . origin_group_name ]. id ]
138138 cdn_frontdoor_custom_domain_ids = [azurerm_cdn_frontdoor_custom_domain . fd_custom_domains [each . value . custom_domain_name ]. id ]
139-
140- enabled = each. value . enabled
141- patterns_to_match = each. value . patterns_to_match
142- supported_protocols = each. value . supported_protocols
143- https_redirect_enabled = false
144- forwarding_protocol = " HttpsOnly"
145- link_to_default_domain = false
139+
140+ enabled = each. value . enabled
141+ patterns_to_match = each. value . patterns_to_match
142+ supported_protocols = each. value . supported_protocols
143+ https_redirect_enabled = false
144+ forwarding_protocol = " HttpsOnly"
145+ link_to_default_domain = false
146146}
147147
148148data "azurerm_cdn_frontdoor_firewall_policy" "fd_firewall_policy" {
149- count = var. security_policy == null ? 0 : 1
149+ count = var. security_policy == null ? 0 : 1
150150 name = var. security_policy . firewall_policy_name
151151 resource_group_name = var. resource_group_name
152152}
153153
154154# Security policy
155155resource "azurerm_cdn_frontdoor_security_policy" "fd_security_policy" {
156156 count = var. security_policy == null ? 0 : 1
157- name = " ${ var . security_policy . firewall_policy_name } -securityPolicy"
157+ name = " ${ var . security_policy . firewall_policy_name } -securityPolicy"
158158 cdn_frontdoor_profile_id = azurerm_cdn_frontdoor_profile. fd_profile . id
159159
160160 security_policies {
0 commit comments