This example is part of the Cisco Network as Code project. Its goal is to allow users to instantiate infrastructure in minutes using an easy to use, opinionated data model. It takes away the complexity of having to deal with references, dependencies or loops. By completely separating data (defining variables) from logic (infrastructure declaration), it allows the user to focus on describing the intended configuration while using a set of maintained and tested Terraform Modules without the need to understand the low-level configuration details. More information can be found here: https://netascode.cisco.com.
Install Terraform (> 1.8.0) and set environment variables with credentials:
export NXOS_USERNAME=admin
export NXOS_PASSWORD=password
Update device IPs in data/inventory.nac.yaml
.
Download all the required providers and modules.
terraform init
Apply and deploy the desired configuration.
terraform apply