vPC Peers
NDFC Terraform

vPC Configuration with Terraform

In this section you will be creating the Terraform configuration for the Fabric vPC Peers

Step 1 - Create modules/fabric/vpc.tf file


touch ~/workspace/ndfclab/terraform/modules/fabric/vpc.tf
code-server -r ~/workspace/ndfclab/terraform/modules/fabric/vpc.tf

The ndfc_vpc_pair resource is used to define a vPC pair in the NDFC fabric. This resource allows you to specify the serial numbers of the devices that will form the vPC pair, and whether to use a virtual peer link.

This resource depends on the ndfc_inventory_devices.nac_inventory_devices_1 resource which was defined in the previous step. This ensures that the inventory devices are created before the vPC pair is configured.


resource "ndfc_vpc_pair" "nac_vpc_pair_1" {
  serial_numbers       = [var.staging-leaf1-serial, var.staging-leaf2-serial]
  use_virtual_peerlink = false
  deploy               = false

  depends_on = [
    ndfc_inventory_devices.nac_inventory_devices_1,
  ]
}


Step 2 - Close All Open VSCode Tabs for Next Terraform Section

In your VSCode application; on the keyword press Ctrl + K + W. This should close all open tabs to clear your workspace.