Sample terraform code with Cisco Cloud Network Controller
This project shows how Cloud Network Controller (CNC) works on GCP, how it normalizes and translates a cloud-like policy model into public cloud native constructs, and how Terraform can be leveraged to automate CNC operations.
High Level Diagram
Use Case: Single Region/Tenant/VRF
Using standard terraform modules, the code builds a single VPC on us-east4 region and enable peering with the infra VPC where CNC is deployed with cloud routers, it then creates two EPGs (Web & DB) which translates to firewall policies and rules, and enable Web access from Internet using contracts.
Pre-requisites
CNC running on a dedicated GCP project. All credentials and sensitive data are defined in a .tfvars file.
Providers
Name | Version |
---|---|
aci | >=2.7.0 |
Installation
- Install and set up your terraform environment
- Clone/copy the .tf files onto your terraform environment
- Create a terraform.tfvars file with your CNC credentials and GCP project used for the user project/VPC
- Optionally, the gcp.tf file deploys two VM instances (web-vm and db-vm) for testing purposes.
Usage
terraform init
terraform plan
terraform apply
Policies
Cloud Networking