-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolicies-global.tf
73 lines (66 loc) · 2.53 KB
/
policies-global.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
/*_____________________________________________________________________________________________________________________
API Information:
- Class: "dnsProfile"
- Distinguished Name: "uni/fabric/dnsp-{name}"
GUI Location:
- Fabric > Fabric Policies > Policies > Global > DNS Profiles > {name}
_______________________________________________________________________________________________________________________
*/
resource "aci_rest_managed" "dns_profiles" {
for_each = local.dns_profiles
class_name = "dnsProfile"
dn = "uni/fabric/dnsp-${each.key}"
content = {
descr = each.value.description
IPVerPreference = each.value.ip_version_preference
name = each.key
}
child {
class_name = "dnsRsProfileToEpg"
rn = "rsProfileToEpg"
content = {
tDn = "uni/tn-mgmt/mgmtp-default/${each.value.mgmt_epg_type}-${each.value.management_epg}"
}
}
}
/*_____________________________________________________________________________________________________________________
API Information:
- Class: "dnsProv"
- Distinguished Name: "uni/fabric/dnsp-{name}/prov-[{dns_provider}]"
GUI Location:
- Fabric > Fabric Policies > Policies > Global > DNS Profiles > {name}: DNS Providers
_______________________________________________________________________________________________________________________
*/
resource "aci_rest_managed" "dns_providers" {
depends_on = [
aci_rest_managed.dns_profiles
]
for_each = local.dns_providers
class_name = "dnsProv"
dn = "uni/fabric/dnsp-${each.value.policy}/prov-[${each.value.dns_provider}]"
content = {
addr = each.value.dns_provider
preferred = each.value.preferred == true ? "yes" : "no"
}
}
/*_____________________________________________________________________________________________________________________
API Information:
- Class: "dnsDomain"
- Distinguished Name: "uni/fabric/dnsp-{name}/dom-[{domain}]"
GUI Location:
- Fabric > Fabric Policies > Policies > Global > DNS Profiles > {name}: DNS Domains
_______________________________________________________________________________________________________________________
*/
resource "aci_rest_managed" "dns_domains" {
depends_on = [
aci_rest_managed.dns_profiles
]
for_each = local.dns_domains
class_name = "dnsDomain"
dn = "uni/fabric/dnsp-${each.value.policy}/dom-${each.value.domain}"
content = {
descr = each.value.description
isDefault = each.value.default_domain == true ? "yes" : "no"
name = each.value.domain
}
}