netascode / terraform-aci-nac-aci

Terraform Cisco ACI Nexus-as-Code Module
https://registry.terraform.io/modules/netascode/nac-aci/aci
Apache License 2.0
17 stars 14 forks source link

Feature Request: Add VPC Interface Support as Static Ports in Endpoint Group Module #65

Closed jorgenspange closed 4 months ago

jorgenspange commented 4 months ago

Would like to be able to add vpc interfaces as static ports in the Endpoint Group module.

juchowan commented 4 months ago

VPC interfaces can be added by specifying channel which maps to an IPG name of VPC interafce, example:

static_ports:
  - channel: KACI-UCSC220M4S-1
    vlan: 123

Is this what you're looking for?

jorgenspange commented 4 months ago

@juchowan thanks for the reply:

it fails like this:

│ Error: Invalid index
│
│   on .terraform/modules/aci/aci_tenants.tf line 429, in module "aci_endpoint_group":
│  429:     node2_id             = sp.node2_id == "vpc" ? [for pg in local.leaf_interface_policy_group_mapping : try(pg.node_ids, []) if pg.name == sp.channel][0][1] : sp.node2_id
│     ├────────────────
│     │ local.leaf_interface_policy_group_mapping is tuple with 6 elements
│     │ sp.channel is "vpc027"
│
│ The given key does not identify an element in this collection value.

With this config:

            static_ports:
              - channel: vpc027
                vlan: 1203

here is the IPG:

    leaf_interface_policy_groups:
      - name: vpc027
        type: vpc
        aaep: trunkAep
        cdp_policy: cdpEnabled
        link_level_policy: inheritAuto
        lldp_policy: lldpEnabled
        port_channel_policy: lacpActive
        l2_policy: default
        mcp_policy: mcpEnabled
        spanning_tree_policy: bpduFG
        storm_control_policy: default
jorgenspange commented 4 months ago

Got it!

Configured it like this in the epg:

            static_ports:
              - channel: vpc027
                node_id: 2101
                node2_id: 2102
                vlan: 1203
              - channel: vpc028
                node_id: 2101
                node2_id: 2102
                vlan: 1203