From 4819b40e62b5fbe6c2e57193d8202d611ea301ac Mon Sep 17 00:00:00 2001 From: Rob van der Kind Date: Fri, 5 Jul 2024 13:19:01 +0200 Subject: [PATCH] adding support for secondary IP on floating svi --- README.md | 2 +- .../terraform-aci-l3out-interface-profile/README.md | 5 +++-- modules/terraform-aci-l3out-interface-profile/main.tf | 10 ++++++++++ .../terraform-aci-l3out-interface-profile/versions.tf | 2 +- modules/terraform-aci-l3out/README.md | 4 ++-- modules/terraform-aci-l3out/versions.tf | 2 +- versions.tf | 2 +- 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 139fa4c8..aec2981a 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Additional example repositories: | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | -| [aci](#requirement\_aci) | >= 2.6.1 | +| [aci](#requirement\_aci) | >= 2.15.0 | | [local](#requirement\_local) | >= 2.3.0 | | [utils](#requirement\_utils) | >= 0.2.5 | diff --git a/modules/terraform-aci-l3out-interface-profile/README.md b/modules/terraform-aci-l3out-interface-profile/README.md index dbcba8e3..2136dd8c 100644 --- a/modules/terraform-aci-l3out-interface-profile/README.md +++ b/modules/terraform-aci-l3out-interface-profile/README.md @@ -81,13 +81,13 @@ module "aci_l3out_interface_profile" { | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | -| [aci](#requirement\_aci) | >= 2.0.0 | +| [aci](#requirement\_aci) | >= 2.15.0 | ## Providers | Name | Version | |------|---------| -| [aci](#provider\_aci) | >= 2.0.0 | +| [aci](#provider\_aci) | >= 2.15.0 | ## Inputs @@ -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 | diff --git a/modules/terraform-aci-l3out-interface-profile/main.tf b/modules/terraform-aci-l3out-interface-profile/main.tf index 473f85bc..6a56a237 100644 --- a/modules/terraform-aci-l3out-interface-profile/main.tf +++ b/modules/terraform-aci-l3out-interface-profile/main.tf @@ -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 ]) @@ -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}]" diff --git a/modules/terraform-aci-l3out-interface-profile/versions.tf b/modules/terraform-aci-l3out-interface-profile/versions.tf index 9299fb61..f4938bdc 100644 --- a/modules/terraform-aci-l3out-interface-profile/versions.tf +++ b/modules/terraform-aci-l3out-interface-profile/versions.tf @@ -5,7 +5,7 @@ terraform { required_providers { aci = { source = "CiscoDevNet/aci" - version = ">= 2.0.0" + version = ">= 2.15.0" } } } diff --git a/modules/terraform-aci-l3out/README.md b/modules/terraform-aci-l3out/README.md index 1dcaa139..09db4b35 100644 --- a/modules/terraform-aci-l3out/README.md +++ b/modules/terraform-aci-l3out/README.md @@ -72,13 +72,13 @@ module "aci_l3out" { | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | -| [aci](#requirement\_aci) | >= 2.0.0 | +| [aci](#requirement\_aci) | >= 2.15.0 | ## Providers | Name | Version | |------|---------| -| [aci](#provider\_aci) | >= 2.0.0 | +| [aci](#provider\_aci) | >= 2.15.0 | ## Inputs diff --git a/modules/terraform-aci-l3out/versions.tf b/modules/terraform-aci-l3out/versions.tf index 9299fb61..f4938bdc 100644 --- a/modules/terraform-aci-l3out/versions.tf +++ b/modules/terraform-aci-l3out/versions.tf @@ -5,7 +5,7 @@ terraform { required_providers { aci = { source = "CiscoDevNet/aci" - version = ">= 2.0.0" + version = ">= 2.15.0" } } } diff --git a/versions.tf b/versions.tf index 41c5caef..c39e1c73 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aci = { source = "CiscoDevNet/aci" - version = ">= 2.6.1" + version = ">= 2.15.0" } utils = { source = "netascode/utils"