Automation Pipelines
Automation pipelines are a set of automated processes that allow you to build, test, and deploy your code in a consistent and repeatable manner. They are essential for ensuring that your code is always in a deployable state and that any changes made to the code are thoroughly tested before being deployed to production.
We hear this in the context of software development, which isn’t what you are normally used to discussing with network operations. Yet many of these concepts are applicable to network operations as well. In the context of Network as Code with SD-WAN, we utilize Terraform and automated testing to deploy configuration changes to SD-WAN Manager. The important element is that network changes are integrated into this software pipeline such that changes are integrated with validation and other software practices.
What is an Automation Pipeline?
Section titled “What is an Automation Pipeline?”An automation pipeline is a series of automated steps that take your code from development to production. It typically includes the following stages:
- Source Control: The code is stored in a version control system (VCS) such as Git. This allows for tracking changes, collaboration, and rollback if necessary.
- Validate: The code is validated for syntax, semantics, and compliance before any deployment attempts.
- Plan: The system calculates what changes need to be made to reach the desired state.
- Deploy: The validated changes are applied to the target environment, such as SD-WAN Manager.
- Test: Automated tests are run to ensure that the deployed configuration matches the intended state.
We can make the connection between these high level software concepts and network operations by looking at the following table:
| Stage | Software Development | SD-WAN Operations Equivalent |
|---|---|---|
| Source Control | Utilized to manage all code. Provides version control and tracking. | Utilized to manage all SD-WAN configuration data models. Provides version control and tracking. |
| Validate | Runs linters and static analysis to ensure code quality. | Validates data model syntax, schema compliance, and semantic rules using nac-validate. |
| Plan | Compiles code, packages files, prepares environment. | Runs terraform plan to calculate required changes to SD-WAN fabric. |
| Deploy | Deploys code to target environment. | Deploys configuration changes to SD-WAN Manager via terraform apply. |
| Test | Runs automated tests to ensure code functions as expected. | Validates configuration and operational states after deployment using iac-test. |
When you observe this in the context of software development, developers commit code into branches that are processed via software linting and other tools to ensure the code matches expected standards. Once peer review approves the code this is then moved to control branches like develop for further testing and integration. Finally code is then merged, compiled and tested to established standards.
The advantage of this for SD-WAN configuration changes is the ability to integrate what we have mentioned before: Semantic validation, pre and post testing, and automated deployment. Network engineers simply codify intended state and the software pipeline is executed transparently to ensure all the required steps are completed to push the configuration correctly to the SD-WAN fabric.
Pipelines and Network as Code for SD-WAN
Section titled “Pipelines and Network as Code for SD-WAN”For Network as Code with SD-WAN, we combine the different stages of execution using Terraform to create different stages based on Infrastructure as Code principles.

Pipeline Stages Overview
Section titled “Pipeline Stages Overview”The SD-WAN as Code pipeline consists of five main stages:
stages: - validate - plan - deploy - test - notifyEach stage has specific responsibilities and dependencies, ensuring a robust and reliable deployment process.
Validation Stage (pre-deployment validation)
Section titled “Validation Stage (pre-deployment validation)”The validation stage is the first and most critical step in our pipeline, serving as a gatekeeper to ensure that only valid configurations proceed to deployment. This stage performs comprehensive checks on the SD-WAN data model before any changes are applied to the network infrastructure.
What happens during validation:
Terraform Format Check: Ensures all Terraform files follow proper formatting standards:
Terminal window terraform fmt -checkData Model Validation: Uses
nac-validateto check data model syntax and semantics:Terminal window nac-validate ./data/Schema Compliance: The data model is validated against the predefined SD-WAN schema to ensure all required fields are present and data types are correct. This includes checking for:
- Mandatory fields like chassis IDs and device models
- Proper IP address formats
- Valid device template references
- Correct feature template associations
Semantic Validation: Beyond basic schema compliance, the validation includes semantic checks that ensure the configuration makes logical sense from an SD-WAN perspective:
- Device template and feature template compatibility
- Policy object references exist
- Site configurations match template requirements
- Variable consistency across templates
Validation Configuration
Section titled “Validation Configuration”validate: stage: validate script: - set -o pipefail && terraform fmt -check |& tee fmt_output.txt - set -o pipefail && nac-validate ./data/ |& tee validate_output.txt artifacts: paths: - fmt_output.txt - validate_output.txt cache: [] rules: - if: $CI_COMMIT_TAG == nullBranch Strategy Integration: The validation stage runs on all branches except tags, providing early feedback to network engineers. When a network operator commits changes to any branch, the pipeline automatically runs validation-only jobs, allowing for rapid iteration and error correction.
Benefits of Early Validation:
- Fast Feedback Loop: Engineers receive immediate feedback on their changes without waiting for full deployment cycles
- Reduced Risk: Invalid configurations are caught before they can impact the SD-WAN fabric
- Collaborative Development: Multiple engineers can work on different aspects of the SD-WAN configuration with confidence
- Cost Efficiency: Prevents costly deployment failures by catching errors early
Planning Stage
Section titled “Planning Stage”The planning stage uses Terraform’s planning capabilities to calculate exactly what changes need to be made to the SD-WAN fabric to reach the desired state. This stage provides a preview of changes before any actual deployment occurs.
Planning Process:
Terraform Initialization: The pipeline initializes Terraform, downloading required providers and modules:
Terminal window terraform init -input=falsePlan Generation: Creates a detailed execution plan:
Terminal window terraform plan -out=plan.tfplan -input=falsePlan Analysis: Converts the plan to multiple formats for analysis:
Terminal window terraform show -no-color plan.tfplan > plan.txtterraform show -json plan.tfplan | jq > plan.jsonChange Summary: Generates a summary of planned changes:
Terminal window terraform show -json plan.tfplan | jq '([.resource_changes[]?.change.actions?]|flatten)|{"create":(map(select(.=="create"))|length),"update":(map(select(.=="update"))|length),"delete":(map(select(.=="delete"))|length)}' > plan_gitlab.json
Planning Configuration
Section titled “Planning Configuration”plan: stage: plan resource_group: sdwan script: - terraform init -input=false - terraform plan -out=plan.tfplan -input=false - terraform show -no-color plan.tfplan > plan.txt - terraform show -json plan.tfplan | jq > plan.json - terraform show -json plan.tfplan | jq '([.resource_changes[]?.change.actions?]|flatten)|{"create":(map(select(.=="create"))|length),"update":(map(select(.=="update"))|length),"delete":(map(select(.=="delete"))|length)}' > plan_gitlab.json - python3 .ci/gitlab-comment.py artifacts: paths: - plan.json - plan.txt - plan.tfplan - plan_gitlab.json reports: terraform: plan_gitlab.json dependencies: [] needs: - validate only: - merge_requests - masterPlanning Benefits:
- Change Visibility: Engineers can review exactly what will change before deployment
- Risk Assessment: Plans help identify potentially disruptive changes
- Approval Workflows: Plans can be reviewed in merge requests before deployment
- Consistency: The same plan is used for deployment, ensuring no drift between planning and execution
- Resource Groups: The
sdwanresource group ensures only one plan/deploy can run at a time
Deployment Stage
Section titled “Deployment Stage”The deployment stage transforms validated configuration data into actual SD-WAN state through Terraform’s declarative deployment model. This stage represents the critical transition from intent (as expressed in the data model) to reality (as configured in SD-WAN Manager).
Deployment Process:
- Terraform Initialization: Re-initializes Terraform to ensure consistency
- Plan Application: Applies the exact plan generated in the previous stage:
Terminal window terraform apply -input=false -auto-approve plan.tfplan
Deployment Configuration
Section titled “Deployment Configuration”deploy: stage: deploy resource_group: sdwan script: - terraform init -input=false - terraform apply -input=false -auto-approve plan.tfplan dependencies: - plan needs: - plan only: - masterSafety Mechanisms:
- Branch Protection: Deploy stage only runs on the master branch
- Dependency Validation: Explicit dependencies on successful validation and planning stages
- Resource Groups: Prevents concurrent deployments that could cause conflicts
- Plan Consistency: Uses the exact plan from the previous stage, ensuring predictable results
- State Management: Terraform maintains state consistency across deployments
Deployment Benefits:
- Predictable Changes: Uses pre-approved plans for deployment
- Atomic Operations: Changes are applied in the correct order with proper dependencies
- State Tracking: Terraform state provides accurate tracking of managed resources
- Rollback Capability: Previous configurations can be restored if needed
Testing Stage (post-deployment validation)
Section titled “Testing Stage (post-deployment validation)”The testing stage provides critical verification that the deployed configuration matches the intended state and that the SD-WAN fabric is functioning as expected. This stage includes both integration testing and idempotency verification.
Integration Testing
Section titled “Integration Testing”Validates that the deployed configuration matches the data model:
test-integration: stage: test script: - set -o pipefail && iac-test -d ./data -d ./defaults.yaml -t ./tests/templates -f ./tests/filters -o ./tests/results/sdwan |& tee test_output.txt artifacts: when: always paths: - tests/results/sdwan/*.html - tests/results/sdwan/xunit.xml - test_output.txt reports: junit: tests/results/sdwan/xunit.xml dependencies: - deploy needs: - deploy only: - masterIdempotency Testing
Section titled “Idempotency Testing”Verifies that the system is in a stable state with no configuration drift:
test-idempotency: stage: test resource_group: sdwan script: - terraform init -input=false - terraform plan -input=false -detailed-exitcode dependencies: - deploy needs: - deploy only: - masterWhat Testing Validates:
- Configuration Accuracy: Verifies that the configuration deployed to SD-WAN Manager exactly matches what was defined in the data model
- Template Integrity: Confirms device templates and feature templates are properly created and associated
- Policy Application: Validates that centralized and localized policies are correctly applied
- Site Configuration: Ensures devices are properly attached to templates with correct variables
- System Stability: Idempotency tests confirm no unexpected changes are detected
Testing Benefits:
- Confidence in Changes: Engineers can be confident that deployed changes work as intended
- Rapid Issue Detection: Problems are identified immediately after deployment
- Compliance Documentation: Test reports serve as evidence for change documentation and audit processes
- Drift Detection: Idempotency tests identify configuration drift from manual changes
Notification Stage
Section titled “Notification Stage”The notification stage provides stakeholders with real-time updates about deployment status and results through Webex Teams integration.
Success Notifications
Section titled “Success Notifications”success: stage: notify script: - python3 .ci/webex-notification-gitlab.py -s when: on_success artifacts: when: always paths: - tests/results/sdwan/*.html - tests/results/sdwan/xunit.xml - plan.txt - fmt_output.txt - validate_output.txt - test_output.txt cache: []Failure Notifications
Section titled “Failure Notifications”failure: stage: notify script: - python3 .ci/webex-notification-gitlab.py -f when: on_failure artifacts: when: always paths: - tests/results/sdwan/*.html - tests/results/sdwan/xunit.xml - plan.txt - fmt_output.txt - validate_output.txt - test_output.txt cache: []Notification Features:
- Webex Teams Integration: Sends rich notifications to designated Webex spaces
- Status Awareness: Different messages for success and failure scenarios
- Artifact Collection: All pipeline outputs are collected and made available
- Stakeholder Communication: Keeps teams informed without manual monitoring
Pipeline Configuration and Variables
Section titled “Pipeline Configuration and Variables”The SD-WAN pipeline uses environment variables to securely manage credentials and configuration:
variables: ## Disable SSL verification for git operations (lab environments only) GIT_SSL_NO_VERIFY: "true"
## SD-WAN Manager Connection SDWAN_USERNAME: description: "Cisco SDWAN Username" SDWAN_PASSWORD: description: "Cisco SDWAN Password" SDWAN_URL: description: "Cisco SDWAN URL"
## GitLab Integration GITLAB_TOKEN: description: "User Access Token for GitLab API operations" GITLAB_API_URL: description: "GitLab API v4 root URL" value: "${CI_API_V4_URL}"
## Terraform State Management TF_HTTP_ADDRESS: description: "GitLab HTTP Address to store the TF state file" value: "${GITLAB_API_URL}/projects/${CI_PROJECT_ID}/terraform/state/tfstate" TF_HTTP_USERNAME: description: "GitLab Username for state operations" TF_HTTP_PASSWORD: description: "GitLab Access Token for state operations"
## Webex Notifications WEBEX_ROOM_ID: description: "Cisco Webex Room ID for notifications" WEBEX_TOKEN: description: "Cisco Webex Bot Token"Terraform State Management
Section titled “Terraform State Management”The pipeline uses GitLab as the Terraform backend for state management:
cache: key: terraform_modules_and_lock paths: - .terraform - .terraform.lock.hcl - defaults.yamlBenefits of GitLab State Backend:
- Centralized State: All team members access the same state
- State Locking: Prevents concurrent modifications
- Version History: GitLab maintains state version history
- Access Control: Leverages GitLab’s existing security model
Branch Strategy and Workflow
Section titled “Branch Strategy and Workflow”Feature Branch Workflow
Section titled “Feature Branch Workflow”Create Feature Branch: Developers create branches for specific changes
Terminal window git checkout -b conf-changeMake Changes: Modify data model files as needed
Push Branch: Trigger validation and planning stages
Terminal window git add .git commit -m "Update TLOC preferences"git push origin conf-changeCreate Merge Request: Request review and approval
Merge to Master: Trigger full deployment pipeline
Pipeline Behavior by Branch
Section titled “Pipeline Behavior by Branch”| Branch Type | Validation | Planning | Deployment | Testing |
|---|---|---|---|---|
| Feature Branch | ✅ | ❌ | ❌ | ❌ |
| Merge Request | ✅ | ✅ | ❌ | ❌ |
| Master Branch | ✅ | ✅ | ✅ | ✅ |
This strategy provides:
- Safe Development: Feature branches only run validation
- Change Preview: Merge requests show planned changes
- Protected Deployment: Only master branch deploys to production
Pipeline Benefits and Best Practices
Section titled “Pipeline Benefits and Best Practices”Key Benefits
Section titled “Key Benefits”Risk Reduction: Every change is validated multiple times - first against schema and rules, then through Terraform planning, and finally through post-deployment testing. This multi-layered approach dramatically reduces the risk of network outages or misconfigurations.
Consistency: All network changes follow the same standardized process, eliminating the variability that comes from manual processes or individual engineer preferences.
Auditability: Every change is tracked in version control, with complete visibility into who made what changes, when they were made, and what testing was performed.
Scalability: As SD-WAN complexity grows, the pipeline approach scales much better than manual processes, allowing teams to manage larger and more complex network infrastructures.
Traditional vs Pipeline Approach Comparison
Section titled “Traditional vs Pipeline Approach Comparison”| Traditional Manual Process | Automated Pipeline Process |
|---|---|
| 👤 Manual Configuration | 🤖 Automated Validation |
| ❌ Human Error Prone | ✅ Consistent & Reliable |
| 📝 Manual Documentation | 📊 Automatic Audit Trail |
| 🐌 Slow & Sequential | ⚡ Fast & Parallel |
| 🔍 Limited Testing | 🧪 Comprehensive Testing |
Best Practices
Section titled “Best Practices”Security
Section titled “Security”- Credential Management: Use GitLab CI/CD variables with masking enabled
- State Security: Leverage GitLab’s access controls for state management
- Network Security: Use secure connections to SD-WAN Manager (HTTPS)
Reliability
Section titled “Reliability”- Resource Groups: Prevent concurrent pipeline runs that could cause conflicts
- Artifact Preservation: Save all pipeline outputs for troubleshooting
- Comprehensive Testing: Include both configuration and idempotency tests
Collaboration
Section titled “Collaboration”- Branch Protection: Require reviews before merging to master
- Clear Notifications: Use Webex integration to keep teams informed
- Documentation: Maintain clear commit messages and change descriptions
Performance
Section titled “Performance”- Caching: Cache Terraform modules and state between runs
- Parallel Execution: Run independent tests in parallel where possible
- Selective Execution: Use rules to control when stages execute
Summary
Section titled “Summary”Automation pipelines represent a fundamental shift in how SD-WAN changes are managed, bringing the reliability and consistency of software development practices to network operations. By implementing the multi-stage pipeline approach (validate, plan, deploy, test, notify) with Network as Code for SD-WAN, organizations can significantly reduce the risk of network outages while improving the speed and consistency of network changes.
The combination of data model validation, Terraform-based deployment, and post-deployment testing creates a robust framework that ensures SD-WAN configurations are both syntactically correct and operationally sound. This foundation prepares network engineering teams to embrace Infrastructure as Code practices while maintaining the reliability and security that network operations demand.
The pipeline approach provides:
- Predictable Change Management: Every change follows the same validated process
- Risk Mitigation: Multiple validation layers catch errors before they impact production
- Operational Visibility: Complete audit trail of all changes and their impacts
- Scalable Operations: Handle complex SD-WAN deployments with confidence
- Team Collaboration: Enable multiple engineers to work on SD-WAN configurations safely
In the next section, we will implement a working automation pipeline for Network as Code with SD-WAN, putting these concepts into practice with hands-on configuration and deployment.