Introduction
Network as Code allows for complete separation of data (defining variables) from logic (infrastructure declaration). With little to no knowledge about automation, users can instantiate Catalyst SD-WAN Overlays in minutes, following the menu structure of the Catalyst SD-WAN Manager. This is achieved by separating the *.yaml
files which contain the desired SD-WAN state from the Terraform Modules which map the definition of the desired state to Terraform modules and resources. The data model and modules used in Network as Code are open-source and available as-is. For support and or customization it is required to engage with Cisco Professional Services.
The tree
output below shows an example of a data model where the *.yaml
files compose logical groups that map to constructs that SD-WAN users are very familiar with.
Directorydata
- configuration_group.nac.yaml
- feature_profiles.nac.yaml
- wan_vpn_inet.nac.yaml
- wan_vpn_mpls.nac.yaml
- sites.nac.yaml
- defaults.nac.yaml
- main.tf
Configuration for wan_vpn_inet
ethernet interface feature can simply be managed via the wan_vpn_inet.nac.yaml
:
---sdwan: feature_profiles: transport_profiles: - name: transport wan_vpn: ethernet_interfaces: - name: inet interface_name_variable: inet_interface_name ipv4_configuration_type: dynamic shutdown: false tunnel_interface: color: biz-internet
SD-WAN Provider
The Terraform provider for Catalyst SD-WAN includes resource which can be used to manage SD-WAN features and policies. A simple example of how to use the resource can be found below:
resource "sdwan_system_feature_profile" "system_feature_profile" { name = "system" description = "example system profile"}
The SD-WAN resources are not only capable of pushing a configuration but also reading its state and reconcile configuration drift.
Terraform Modules
A Terraform module is a container for multiple resources that are used together. Modules can be used to create lightweight abstractions. While a Terraform resource represents a single API object (single feature/policy in case of SD-WAN), a Terraform Module consists of multiple resources.
A simple example of using one of the modules can be found below:
module "sdwan" { source = "netascode/nac-sdwan/sdwan" version = "1.1.0" yaml_directories = ["data"]}
Network as Code for SD-WAN Module
The Network as Code Terraform module for Catalyst SD-WAN is responsible for mapping the data to the corresponding SD-WAN modules. This module supports an inventory driven approach, where a complete SD-WAN configuration is either modeled in one or more YAML files or natively using Terraform variables.
The module ships with default values for certain objects. These values are documented in the Data Model section on this page. a single file defaults.nac.yaml
can be used to define specific requirements in a central location. This will overwrite any default values that come with the main modules.
This file is typically customized to reflect the specific customer requirements and reduces the overall size of input files as optional parameters with a default value can be omitted.
The Network as Code for SD-WAN section includes a simple example to get started with Network as Code for SD-WAN deployments.
Additional services
Cisco Customer Experience (CX) is able to help you with many additional services such as CI/CD integration, pre-change validation, integration with Information Technology Service Management (ITSM), as well as automated testing. Please reach out to your Cisco account team for more information.