Skip to content

Commit

Permalink
adding support for secondary IP on floating svi
Browse files Browse the repository at this point in the history
  • Loading branch information
robvand committed Jul 12, 2024
1 parent 3be5f27 commit d60c581
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions modules/terraform-aci-l3out-interface-profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ module "aci_l3out_interface_profile" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_aci"></a> [aci](#requirement\_aci) | >= 2.0.0 |
| <a name="requirement_aci"></a> [aci](#requirement\_aci) | >= 2.15.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aci"></a> [aci](#provider\_aci) | >= 2.0.0 |
| <a name="provider_aci"></a> [aci](#provider\_aci) | >= 2.15.0 |

## Inputs

Expand Down Expand Up @@ -150,6 +150,7 @@ module "aci_l3out_interface_profile" {
| [aci_rest_managed.l3extIp](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource |
| [aci_rest_managed.l3extIp_A](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource |
| [aci_rest_managed.l3extIp_B](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource |
| [aci_rest_managed.l3extIp_floating](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource |
| [aci_rest_managed.l3extLIfP](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource |
| [aci_rest_managed.l3extMember_A](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource |
| [aci_rest_managed.l3extMember_B](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource |
Expand Down
10 changes: 10 additions & 0 deletions modules/terraform-aci-l3out-interface-profile/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ locals {
node_id = int.node_id
pod_id = int.pod_id
scope = int.scope
ip_shared = int.ip_shared
}
} if int.floating_svi == true
])
Expand Down Expand Up @@ -346,6 +347,15 @@ resource "aci_rest_managed" "l3extVirtualLIfP" {
}
}

resource "aci_rest_managed" "l3extIp_floating" {
for_each = { for item in local.floating_interfaces : item.key => item.value if item.value.ip_shared != null }
dn = "${aci_rest_managed.l3extVirtualLIfP[each.key].dn}/addr-[${each.value.ip_shared}]"
class_name = "l3extIp"
content = {
addr = each.value.ip_shared
}
}

resource "aci_rest_managed" "l3extRsDynPathAtt" {
for_each = { for item in local.floating_paths : item.key => item.value }
dn = "${aci_rest_managed.l3extVirtualLIfP[each.value.node].dn}/rsdynPathAtt-[uni/${each.value.domain}]"
Expand Down
2 changes: 1 addition & 1 deletion modules/terraform-aci-l3out-interface-profile/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
required_providers {
aci = {
source = "CiscoDevNet/aci"
version = ">= 2.0.0"
version = ">= 2.15.0"
}
}
}

0 comments on commit d60c581

Please sign in to comment.