Skip to content

Commit 5b94d96

Browse files
committed
move aci_dhcp_relay_policy to aci_rest_managed
1 parent 8e70194 commit 5b94d96

File tree

2 files changed

+43
-15
lines changed

2 files changed

+43
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ A comprehensive example using this module is available here: https://github.com/
1515
| Name | Version |
1616
|------|---------|
1717
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
18-
| <a name="requirement_aci"></a> [aci](#requirement\_aci) | >= 2.5.2 |
18+
| <a name="requirement_aci"></a> [aci](#requirement\_aci) | >= 2.6.0 |
1919
## Providers
2020

2121
| Name | Version |
2222
|------|---------|
23-
| <a name="provider_aci"></a> [aci](#provider\_aci) | >= 2.5.2 |
23+
| <a name="provider_aci"></a> [aci](#provider\_aci) | >= 2.6.0 |
2424
## Inputs
2525

2626
| Name | Description | Type | Default | Required |

policies-global.tf

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,51 @@ GUI Location:
4848
- Fabric > Access Policies > Policies > Global > DHCP Relay > {name}
4949
_______________________________________________________________________________________________________________________
5050
*/
51-
resource "aci_dhcp_relay_policy" "dhcp_relay" {
52-
for_each = local.dhcp_relay
53-
annotation = each.value.annotation
54-
description = each.value.description
55-
mode = each.value.mode
56-
name = each.key
57-
owner = "infra"
58-
tenant_dn = "uni/infra"
59-
relation_dhcp_rs_prov {
60-
addr = each.value.address
61-
tdn = length(
51+
resource "aci_rest_managed" "dhcp_relay" {
52+
for_each = local.dhcp_relay
53+
class_name = "dhcpRelayP"
54+
dn = "uni/infra/relayp-${each.key}"
55+
content = {
56+
# annotation = each.value.annotation
57+
descr = each.value.description
58+
mode = each.value.mode
59+
name = each.key
60+
owner = "infra"
61+
}
62+
child {
63+
rn = length(
6264
regexall("external_epg", each.value.epg_type)
63-
) > 0 ? "uni/tn-${each.value.tenant}/out-${each.value.l3out}/instP-${each.value.epg}" : length(
65+
) > 0 ? "rsprov-[uni/tn-${each.value.tenant}/out-${each.value.l3out}/instP-${each.value.epg}]" : length(
6466
regexall("application_epg", each.value.epg_type)
65-
) > 0 ? "uni/tn-${each.value.tenant}/ap-${each.value.application_profile}/epg-${each.value.epg}" : ""
67+
) > 0 ? "rsprov-[uni/tn-${each.value.tenant}/ap-${each.value.application_profile}/epg-${each.value.epg}]" : ""
68+
class_name = "dhcpRsProv"
69+
content = {
70+
addr = each.value.address
71+
tDn = length(
72+
regexall("external_epg", each.value.epg_type)
73+
) > 0 ? "uni/tn-${each.value.tenant}/out-${each.value.l3out}/instP-${each.value.epg}" : length(
74+
regexall("application_epg", each.value.epg_type)
75+
) > 0 ? "uni/tn-${each.value.tenant}/ap-${each.value.application_profile}/epg-${each.value.epg}" : ""
76+
}
6677
}
6778
}
79+
#resource "aci_dhcp_relay_policy" "dhcp_relay" {
80+
# for_each = local.dhcp_relay
81+
# annotation = each.value.annotation
82+
# description = each.value.description
83+
# mode = each.value.mode
84+
# name = each.key
85+
# owner = "infra"
86+
# tenant_dn = "uni/infra"
87+
# relation_dhcp_rs_prov {
88+
# addr = each.value.address
89+
# tdn = length(
90+
# regexall("external_epg", each.value.epg_type)
91+
# ) > 0 ? "uni/tn-${each.value.tenant}/out-${each.value.l3out}/instP-${each.value.epg}" : length(
92+
# regexall("application_epg", each.value.epg_type)
93+
# ) > 0 ? "uni/tn-${each.value.tenant}/ap-${each.value.application_profile}/epg-${each.value.epg}" : ""
94+
# }
95+
#}
6896

6997
/*_____________________________________________________________________________________________________________________
7098

0 commit comments

Comments
 (0)