forked from claranet/terraform-azurerm-cdn-frontdoor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathr-naming.tf
117 lines (99 loc) · 4.94 KB
/
r-naming.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
data "azurecaf_name" "cdn_frontdoor_profile" {
name = var.stack
resource_type = "azurerm_cdn_frontdoor_profile"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, var.use_caf_naming ? "" : "cfdp"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_endpoint" {
for_each = try({ for endpoint in var.endpoints : endpoint.name => endpoint }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_endpoint"
prefixes = coalesce(compact([local.name_prefix, each.value.prefix]))
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfde"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_origin_group" {
for_each = try({ for origin_group in var.origin_groups : origin_group.name => origin_group }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_origin_group"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfdog"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_origin" {
for_each = try({ for origin in var.origins : origin.name => origin }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_origin"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfdo"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_custom_domain" {
for_each = try({ for custom_domain in var.custom_domains : custom_domain.name => custom_domain }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_custom_domain"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfdcd"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_route" {
for_each = try({ for route in var.routes : route.name => route }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_route"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfdroute"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_rule_set" {
for_each = try({ for rule_set in var.rule_sets : rule_set.name => rule_set }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_rule_set"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfdrs"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_rule" {
for_each = try({ for rule in local.rules_per_rule_set : format("%s.%s", rule.rule_set_name, rule.name) => rule }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_rule"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.rule_set_name, each.value.name, var.use_caf_naming ? "" : "cfdr"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_firewall_policy" {
for_each = try({ for firewall_policy in var.firewall_policies : firewall_policy.name => firewall_policy }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_firewall_policy"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfdfp"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}
data "azurecaf_name" "cdn_frontdoor_security_policy" {
for_each = try({ for security_policy in var.security_policies : security_policy.name => security_policy }, {})
name = var.stack
resource_type = "azurerm_cdn_frontdoor_security_policy"
prefixes = var.name_prefix == "" ? null : [local.name_prefix]
suffixes = compact([var.client_name, var.environment, local.name_suffix, each.value.name, var.use_caf_naming ? "" : "cfdsp"])
use_slug = var.use_caf_naming
clean_input = true
separator = "-"
}